User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







objective-c:foundation.framework:nsmutablearray.h:addobject

This is an old revision of the document!


addObject

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.

Source Code Example

NSMutableArray *mArray = [[NSMutableArray alloc] init];
 
//adding object
[mArray addObject:@"Hello"];
 
// displaying the contents of the array into the console
for(id obj in mArray) {
   NSLog("%@", mArray);
}

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsmutablearray.h/addobject.1371167851.txt · Last modified: 2024/02/16 01:11 (external edit)

Impressum Datenschutz