Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
i got string which is String *newID=@"12390,12391,12392,12394,12394,12395,12396"
this is the request send to me.
I need to add each id from string into NSMutableArray or NSMutableDictionary.
NSString *newID=@"12390,12391,12392,12394,12394,12395,12396"; NSMutableArray *arrayIds = [[newID componentsSeparatedByString:@","] mutableCopy];
Add a comment
array = [newID componentsSeparatedByString:@","];
Try
NSString *newID=@"12390,12391,12392,12394,12394,12395,12396"; NSArray *arrays = [newID componentsSeparatedByString:@","]; NSMutableArray *arr = [NSMutableArray arrayWithArray:arrays];
NSString *newID=@"12390,12391,12392,12394,12394,12395,12396"; NSArray *arrayIds = [newID componentsSeparatedByString:@","]; NSString *str1=[arrayIds objectAtIndex:0]; NSString *str2=[arrayIds objectAtIndex:1]; . . .
NSString *newID=@"12390,12391,12392,12394,12394,12395,12396";
array=[newID componentsSeparatedByString:@","];
(if you use another method)[array retain];
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.