My app's string & amp; Nbsp ;, & amp; Gt; And & amp; Lt; In the text in UITextView we can change the string to the right place. We know that the UITextView string will change & amp; Nbsp; In space, & amp; Gt; To & gt; And & amp; Lt; From & lt;. What should we do if UITextView do not convert it to that character or how to add that string to UITextView?
First thanks. Regards.
+ (NSString *) extractTextFromXML: (NSString *) xml {// Will Only NSMutableString * Text = [NSMutableString string] Keep the text; NSInteger startOfSubstring = 0; The first example of "//" NSRG OriginTaggerz = [XML RangeOffString: @ "& lt;"]; While (startTagRange.location! = NSNotFound) {// Removes the text from the last position "<< NSString * substring = [XML substringWithRange: NSMakeRange (startOfSubstring, startTagRange.location-startOfSubstring)]; // Removes whitespace from sub-string [text appstressing: [string stringbitingingscarsetsset: [NSCR Actorset Whitespacekwareet]]]; // "searching for"; From "& lt;" String NSRange startTagToEndRange = NSMakeRange (startTagRange.location, [xml length] -startTagRange.location) to the end; NSRange endangering = [xml rangeOfString: @ "& gt;" Options: NSCaseInsensitiveSearch limit: startTagToEndRange]; // if "& gt;" After this, the next location of the sub-location is set, followed by (endTagRange.location! = NSNotFound) {startOfSubstring = endTagRange.location + 1; } // If not "& gt;", then attaches the remaining string and gives other returns {{text appendString: [xml substringFromIndex: startTagRange.location]] ;; Return text; } // Next finds "& lt;" String nsrange endagatoundrange = nsmkrange (startoffsbustring, [xml length] -startoff asbestring); StartTagRange = [XML Range Overstring: @ "& lt;" Options: NSCaseInsensitiveSearch Category: EndagatAndandange]; } Return text; }
Or you can use UIWebView instead of UITextView
Comments
Post a Comment