Programming Reference/Librarys
Question & Answer
Q&A is closed
// ** Init array ** NSArray *myArray = [[NSArray alloc]init]; // ** Output array ** NSLog(@"myArray: %@", myArray);
If you look at the output for this example code, you`ll see that an empty array was initialized! Because this array is immutable it would make more sense to use a init-method that creates it with some objects or at least one object. For example initWithObjects.
2012-12-02 21:27:29.423 NSArraySample[1536:11303] myArray: ( )