Thursday, May 19, 2011

NSArray objectAtIndex example objc

NSArray objectAtIndex returns the object at the specified index in the array. NSArray objectAtIndex is one of the most popular method used in iPhone SDK.
See following example.[NSArray objectAtIndex example]

Example>

{
      NSArray     *listData = [NSArray arrayWithObjects: @"MyName", @"YourName", @"HisName", nil];
      NSString    *textString;

textString = [listData objectAtIndex:1]; // "YourName".
}