Iphone FBConnect在登录时使我的应用崩溃
我正在尝试将我的应用程序与FBConnect连接,但每次都会崩溃。 它需要所有以前的凭据,然后在登录后崩溃。。 我需要将我的应用程序与此连接,以便在它登录时打开我的应用程序 我的代码是Iphone FBConnect在登录时使我的应用崩溃,iphone,ios,facebook,fbconnect,Iphone,Ios,Facebook,Fbconnect,我正在尝试将我的应用程序与FBConnect连接,但每次都会崩溃。 它需要所有以前的凭据,然后在登录后崩溃。。 我需要将我的应用程序与此连接,以便在它登录时打开我的应用程序 我的代码是 - (void)session:(FBSession*)session didLogin:(FBUID)uid { NSString* fql = [NSString stringWithFormat: @"select uid,name from user where
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
NSString* fql = [NSString stringWithFormat:
@"select uid,name from user where uid == %lld", self.usersession.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
self.post=YES;
self.usersession =session;
NSLog(@"User with id %lld logged in.", uid);
[self getFacebookName];
}
错误
2012-12-31 11:13:16.522 Project[296:11c03] User with id 10000456096786 logged in.
2012-12-31 11:13:16.922 Project[296:11c03] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
** First throw call stack:
(0x17c5052 0x1c58d0a 0x17b1db8 0xa0d5 0x6ed14 0x6f477 0xffea59 0xffce94 0xffdeb7 0xffce4f 0xffcfd5 0xf41f6a 0x20febbd 0x21cb5ea 0x21cb8b5 0x20f5298 0x21cb16b 0x20f5137 0x179997f 0x16fcb73 0x16fc454 0x16fbdb4 0x16fbccb 0x2473879 0x247393e 0x609a9b 0x27c8 0x2725)
如果我在会话中输入代码,则在成功登录后登录到应用程序中。
它和同样的东西崩溃了
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
NSString* fql = [NSString stringWithFormat:
@"select uid,name from user where uid == %lld", self.usersession.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
self.post=YES;
self.usersession =session;
NSLog(@"User with id %lld logged in.", uid);
AppDelegate *appdelegte =(AppDelegate*)[[UIApplication sharedApplication]delegate];
[[[appdelegte navigationController] view]removeFromSuperview];
[[appdelegte window]addSubview:[[appdelegte tabBarController]view]];
[[appdelegte tabBarController]setSelectedIndex:0];
[self getFacebookName];
}
- (void)getFacebookName {
NSString* fql = [NSString stringWithFormat:
@"select uid,name from user where uid == %lld", self.usersession.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
self.post=YES;
}
显示getFacebookName方法你在破坏哪一行?@Prince立即检查代码…我有edited@Luda它实际上完成了..会话didlogin,然后是getFacebookName,然后移动到-(BOOL)resume{
在FBSession.m
中,然后在20次推送后弹出方法crashes@Prince如果我从会话
方法中删除fb行,它将提供nslog登录id-然后,错误
-此端点已被弃用。要临时重新启用它,您可以禁用“2012年8月”平台迁移。它将于2012年8月1日永久禁用。。