samedi 25 avril 2015

Getting what is inside the object in a nsmutabledictionary


I put some breakpoints to see whats is happening, and I have an array that receives the object from a nsmutabledictionary, and it's "working", but not correctly my code is

for(int i=0; i < notificationsArray.count; i++){
    UILocalNotification *notification = [notificationsArray objectAtIndex:i];
    NSDictionary *userInfoCurrent = notification.userInfo;
    NSString *uid = [NSString stringWithFormat:@"%@", [userInfoCurrent valueForKey:@"key1"]];
    firstletter2 = [NSString stringWithFormat:@"%@", uid];




    [alfabeto addObject:firstletter2];

    while((i < notificationsArray.count) && ([firstletter2 isEqualToString:[NSString stringWithFormat:@"%@", _recebelembrete[i]]])){

        [_arrayforkey addObject:[notificationsArray objectAtIndex:i]];
        i++;

    }
    i--;

    //int x = [firstletter2 intValue];
    if([_dictionaryComplete valueForKey:firstletter2] !=nil){


        [_arrayforkey addObject:[_dictionaryComplete valueForKeyPath:firstletter2]];
    }

    [_dictionaryComplete setObject:_arrayforkey forKey:firstletter2];
    _arrayforkey = [[NSMutableArray alloc]init];

This is what appears if I put the breakpoints

arrayforkey __NSArrayM *    @"2 objects"    0x00007f88607223f0

[0] UIConcreteLocalNotification *   0x7f8860479940  0x00007f8860479940

[1] __NSArrayM *    @"1 object" 0x00007f8860483c10

[0] UIConcreteLocalNotification *   0x7f886046e6b0  0x00007f886046e6b0

I need to get the UIConcreteLocalNotification that in inside the _NSArrayM and put on the _arrayforkey.


Aucun commentaire:

Enregistrer un commentaire