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
try this
NSString *str2=@"Hi,How r u";
NSMutableArray *arary = [[NSMutableArray alloc] initWithArray:[str2 componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@", "]]];
NSLog(@"%@",arary);
if you want , as a object
NSString *str2=@"Hi,How r u";
str2 = [str2 stringByReplacingOccurrencesOfString:@"," withString:@" , "];
NSMutableArray *arary = [[NSMutableArray alloc] initWithArray:[str2 componentsSeparatedByString:@" "]];
NSLog(@"%@",arary);