Gurp321 Gurp321 - 1 year ago 90
iOS Question

How to store values at key =0 into nsarray?

I want to store all the emails into an array. What do I need to do for the same ?

Answer Source

Use this code and change it according to your requirement

    NSMutableDictionery * repsonseDict = [[NSMutableDictionery alloc]init];
    repsonseDict =  [reponseObj objectForKey@"response"];

    NSArray * allKeys = [repsonseDict allKeys];

    NSMutableArray * emailArr = [[NSMutableArray alloc]init];

    for(int i = 0; i < [allKeys count]; i ++ ){

      NSString * numberKey = [NSString stringWithFormat:@"%d",i];

     [emailArr addObject:[[repsonseDict objectForKey:numberKey]objectForKey:@"email"]];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download