I have the following output to the console saying that this class is a __NSCFConstantString
NSLog(@"select category instance %@", [[SelectCategory instance] getCategoryText].class);
the output of that the string is: bar|cafe|grocery_or_supermarket|liquor_store|night_club
how do I extract just the first category? (The categories are separated by “|“) In this case it would be “bar“. I then need to store that in a variable.
thanks for any help
Since
__NSCFConstantStringis anNSString, you can use thecomponentsSeparatedByString:method: