User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







objective-c:foundation.framework:nsarray.h:init
click
to support this page (eg 0,42 € or so) Thanks.

init

 
- (id)init
 

Returns an empty array.

Return Value - NSArray

ObjC Sourcecode Example

    // ** 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.

Output for this example code

2012-12-02 21:27:29.423 NSArraySample[1536:11303] myArray: (
)
advertising
objective-c/foundation.framework/nsarray.h/init.txt · Last modified: 2014/05/30 21:47 by 93.219.3.186

Impressum