replaceObjectAtIndex
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:
replaceObjectAtIndexreplaceObjectAtIndex How to write nsmutablearray
replaceobjectatindex withobject?
myModel = [NSMutableArray arrayWithObjects:@"3 animals...:
[myModel
replaceObjectAtIndex:0 withObject:[NSString stringWithFormat:@"%d
Advertisements