私のアプリでは、私はこのようにやっています:
[self.facebook requestWithGraphPath:@"me/friends?fields=name,picture,installed" andDelegate:self];
if ([request.url hasSuffix:@"me/friends?fields=name,picture,installed"])
{
NSMutableArray *array = [NSMutableArray array];
for (NSDictionary *dict in [result objectForKey:@"data"])
{
FacebookUser *friend = [[FacebookUser alloc] initWithDictionary:dict];
[array addObject:friend];
}
NSLog(@"%@", result);
お役に立てば幸いです、
マリオ
編集:
これは私が作成したモデルで、NSObject を実装しています
FacebookUser.h
#import <Foundation/Foundation.h>
@interface FacebookUser : NSObject
@property (readonly) NSString *facebookID;
@property (readonly) NSURL *link;
@property (readonly) NSString *name;
@property (readonly) NSString *pictureURL;
@property (readonly) NSString *firstName;
@property (readonly) NSString *lastName;
FacebookUser.m
#import "FacebookUser.h"
@implementation FacebookUser
@synthesize facebookID = _facebookID;
@synthesize link = _link;
@synthesize name = _name;
@synthesize pictureURL = _pictureURL;
@synthesize firstName = _firstName;
@synthesize lastName = _lastName;
- (id)initWithDictionary:(NSDictionary *)dictionary;
{
self = [super init];
if (self)
{
_facebookID = [dictionary valueForKey:@"id"];
//IMPLEMENT WHAT YOU WANT TO SAVE....
}
return self;
}
@end