NSMutableArray size count numberofitems

NSMutableArray count

NSMutableArray count

Da bei einem NSMutableArray keine size Operation funktioniert, aber die Anzahl der Elemente wichtig ist nutzt man die Operation count.

NSString *firstObject = @“firstObject“;
NSString *secondObject = @“secondObject“;

NSMutableArray *testArray = [[NSMutableArray alloc]init];
[testArray addObject:firstObject];
[testArray addObject:secondObject];

NSLog(@“Size des Arrays: %i“, [testArray count]);

Resultat eine Log Ausgabe:

2009-09-09 12:27:08.838 XML[56422:20b] Size des Arrays: 2

NSMutableArray LogAusgabe

NSMutableArray LogAusgabe