문제

I have a dictionary networks, which is a Dictionary of dictionaries
I'm trying to copy specific entries from networks into compare Addr

- ( NSDictionary * ) compareAddr
{
    NSMutableDictionary *result = [[NSMutableDictionary alloc] init];

    for (id key in networks)
    {
        NSMutableDictionary *result = [[NSMutableDictionary alloc] initWithObjectsAndKeys: @\    [[networks objectForKey: key] objectForKey:@"RSSI"]\, @\key\];
    }                                
    return [NSDictionary ? ? ? :result];
}

But this isn't working for me !

Is it possible ? : what am i doing wrong ?

Thanks for any and all help

도움이 되었습니까?

해결책

From what i can understand from your question, I think that you only need to insert in the result array the desired extracted object and key in this way :

- ( NSDictionary * ) compareAddr
{
    NSMutableDictionary *result = [[NSMutableDictionary alloc] init];

    for (id key in networks)
    {
        [result setObject:[[networks objectForKey: key] objectForKey:@"RSSI"]  forKey:key];
    }                                
    return result;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top