페이스 북에 연결하는 아이폰 애플리케이션을 만들고 있습니다. 첫 번째보기 컨트롤러 버튼을 클릭하여 연결하고 있습니다. 이제 두 번째 버튼을 추가하고 두 번째보기 컨트롤러를 엽니 다. 나는 알파벳 잤다 내 친구의 목록을 표시 그물을 검색 할하지만 난 내 응용 프로그램에서 적용 할 때, 내 위임 클래스에서 ME-아이폰 앱에 페이스 북 친구 목록 표시
도와주세요 런타임에 충돌
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
navController =[[UINavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = navController;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"]
&& [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
[self.window makeKeyAndVisible];
return YES;
}
-(void)fbDidLogin
{
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
}
로드 중 내 친구 목록을 표시하려는 두 번째보기 컨트롤러
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSArray *_permissions = [[NSArray arrayWithObjects:@"read_stream", @"publish_stream", @"offline_access",@"read_friendlists",nil] retain];
[facebook authorize:_permissions];
facebook = [[Facebook alloc] initWithAppId:@"APP_ID_HERE" andDelegate:self];
[facebook requestWithGraphPath:@"me" andDelegate:self];
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
// NSMutableDictionary*params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"4",@"uids", @"name", @"fields", nil];
[facebook requestWithGraphPath:@"me/friends"
andParams:[ NSDictionary dictionaryWithObjectsAndKeys:@"picture,id,name,link,gender,last_name,first_name",@"fields",nil]
andDelegate:self];
}
도움을 주시면 감사하겠습니다.
여기서 충돌 로그를 언급하십시오. – iMash
오류가 발생하면 스택 추적을 붙여 넣으십시오! –
@ user1369291 나는 당신의 질문에 대한 답변을 upvoted 또는 accept하지 않았 음을 알았습니다. 친절하게 도움이되는 유용한 답변을 찾으면 그것을 upvote하십시오. 답변이 귀하의 질문에 대한 답변이라면, 동의하십시오. –