Thursday, May 19, 2011

NSArray arrayWithObjects example objc

An NSArray arrayWithObjects example is shown below. arrayWithObjects method returns a new NSArray object that contains pointer to the specified objects. The parameter list should end with "nil" to indiciate the end of the list. See following code [NSArray arrayWithObjects].

Example>
{
NSArray *KIA;
NSArray *SK;
NSArray *HD;
NSArray *LG;

KIA = [NSArray arrayWithObjects:@"Yun", @"Lee", @"LeeSB",@"Seo", @"Yang", nil];
SK = [NSArray arrayWithObjects:@"Kim", @"Koh", @"KimJ2",@"Jung", nil];
HD = [NSArray arrayWithObjects:@"Clock",@"Hwang", nil];
LG = [NSArray arrayWithObjects:@"Park", @"Bong", nil];

}