User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







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

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 content of the array in 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.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz