Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Answers Viewqa Mobile-Applications replaceObjectAtIndex

Have Programming Question? Ask it here!

Java Coder
1 Answer(s)      2 years and 4 months ago
Posted in : MobileApplications

How to write nsmutablearray replaceobjectatindex withobject?

View Answers

March 28, 2012 at 12:29 PM

myModel = [NSMutableArray arrayWithObjects:@"3 animals", @"dog", @"cat", @"chicken", nil];
// here, wherever else my model is altered:
[myModel replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d animals", myModel.count-1]];

Related Tutorials/Questions & Answers:
replaceObjectAtIndex  How to write nsmutablearray replaceobjectatindex withobject?   myModel = [NSMutableArray arrayWithObjects:@"3 animals...: [myModel replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d
NSMutableArray change object at Index
, it's fine to do like that) [allMessageArray replaceObjectAtIndex:index