Monday, 9 January 2012

How to add and retrieve NSMutableArray value dynamically

NSMutableArray parent class is NSArray


 //Add values dynamically

 NSMutableArray* arr_country = [[NSMutableArray alloc]init];
 [arr_country addObject:@"INDIA"];
 [arr_country addObject:@"RUSSIA"];

 //retrieve array value

id maybeNSString = [arr_country objectAtIndex:(NSUInteger)0]; //return value of the zero th position

//get array count
NSInteger arr_count  = arr_country.count;


2 comments:

  1. -----------------------------------------------------------------------------------------------
    Hire iPhone Developer & Android App Development

    ReplyDelete
  2. IOS7 great development in iphone and providing every type of applications to their users in latest versions. On the side android application development also do it and these can enhance your credibility of your businesses and helpful to their companies which are providing these services.

    ReplyDelete