How to convert string to array in objective C. i.e,I have a string,
NSString *str = @\"Hi,How r u\";
This should be converted into an array *NS
You have to do,
NSString *str = @"Hi,How r u"; NSArray *arr = [str componentsSeparatedByString:@" "];
And, in order for this to work as you expect, there should be a white-space between "Hi," and "How". Your string should look like @"Hi, How r u".
white-space
"Hi,"
"How"
@"Hi, How r u"