Programming Reference/Librarys
Question & Answer
Q&A is closed
The addObject: method is used when dealing with NSMutableArray. It is used to add items onto the stack of the array. A simpler example of this is to imagine a stack of paper. When calling the addObject method, it is essentially the same as a person adding a piece of paper onto the stack of paper.
NSMutableArray *mArray = [[NSMutableArray alloc] init]; //** Adding object ** [mArray addObject:@"Hello"]; //** Displaying the content of the array in console ** for(id obj in mArray) { NSLog("%@", mArray); }