- ( 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];
}
但这不适合我!
有可能吗? : 我究竟做错了什么 ?
感谢您提供的任何帮助
答案 0 :(得分:2)
从我的问题可以理解,我认为你只需要在结果数组中插入所需的提取对象并以这种方式键入:
- ( NSDictionary * ) compareAddr
{
NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
for (id key in networks)
{
[result setObject:[[networks objectForKey: key] objectForKey:@"RSSI"] forKey:key];
}
return result;
}