2013-06-12 127 views

回答

1

我不知道StackOverflow中的程序對於類似的問題究竟如何,無論如何,如果它仍然可以有任何幫助,解決方案是張貼here

報價:

我有一個NSDictionary字典,其關鍵是Facebook的用戶ID和值的名稱。粗略地說,這是代碼:

NSMutableArray *results = [[NSMutableArray alloc] init]; 
for (id key in dict) { 
    NSString *name = [dict valueForKey:key]; 
    id<FBGraphUser> user = (id<FBGraphUser>)[FBGraphObject graphObject]; 
    user.id = key; 
    [user setName:name]; // This is not mandatory 
    if (user) { 
    NSLog(@"adding user: %@", user.name); 
    [results addObject:user]; 
    } 
} 
// And finally set the selection property 
friendPickerController.selection = results;