replaceObjectAtIndex

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:
replaceObjectAtIndex
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
Advertisements

Ads