アプリを FBConnect に接続しようとしていますが、毎回クラッシュします。以前の資格情報をすべて取得し、ログイン後にクラッシュします。ログインすると、アプリが開くように、これに接続する必要があります。
私のコードは
- (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)
session didloginログインに成功した後、アプリに入るためにコードを入力すると。それは同じことでクラッシュします...
- (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;
}