FAQ Database Discussion Community

Parsing NSMutableString By Number Of Instances

I have an NSMutableString that contains a lot of data. A short example of it is: MP3: name length album MP3: name length album MP3: name length album MP3: name length album Now, what I'm trying to accomplish is to parse the string to contain only the first 3 MP3...

Getting an error when creating an NSMutableString when iterating an NSCountedSet in Objective-C

I am iterating an NSCountedSet in a for-loop, and then trying to create an NSMutableString that is composed of the NSString object it holds, as well as the count for that particular object, and then insert the newly created NSMutableString into an NSMutableArray. However, when I do this, I am...

Objective C - Extract substring by finding first and second occurrence of a character

I am trying to port my Android app to iOS. I need to extract the string present between the first and second occurrence of the single quote ' character. For example, from javascript:popUpWindow7('news_details.asp?slno=2029',620,300,100,100,'yes'), I need to extract news_details.asp?slno=2029. In Java, I did this: String inputUrl = "javascript:popUpWindow7('news_details.asp?slno=2029',620,300,100,100,'yes')"; StringBuilder url =...

Difference between stringByAppendingString and appendString in ios

What is the difference between stringByAppendingString and appendString? If NSString is not mutable then how could it append string?