Facebook登录,让自己陷入了一个位置。Facebook IOS SDK登录在模拟器上工作,而不是在设备上
对于我正在做的工作不幸的是,我只能访问运行xcode 3.2.6的Snow Leopard,不能改变它。我知道过去的爆炸。
要获得Facebook登录使用FB SDK 3.0我使用的工作:
AppDelegate.h:
#import <FacebookSDK/FacebookSDK.h>
....
@property (retain, nonatomic) FBSession *session;
AppDelegate.m:
@synthesize session = _session;
...
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [self.session handleOpenURL:url];
}
然后在我的FBLoginViewController.m viewDidLoad中:
MyAppDelegate *appDelegate;
appDelegate = [[UIApplication sharedApplication]delegate];
if (!appDelegate.session.isOpen) {
appDelegate.session = [[FBSession alloc] init];
if (appDelegate.session.state == FBSessionStateCreatedTokenLoaded) {
[appDelegate.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
}];
}
}
现在这个工作在模拟器4.3上。我想确认我有FB应用程序ID在plist中正确设置,与IOS 6的设备将其与崩溃日志的相关章节崩溃测试上说,当应用程序设置是否正确等
但是:
Exception Type: EXC_CRASH (SIGSYS)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyApp 0x000e7cac 0x59000 + 584876
1 libdispatch.dylib 0x34a384b4 0x34a37000 + 5300
2 libdispatch.dylib 0x34a39836 0x34a37000 + 10294
3 MyApp 0x000e7ca0 0x59000 + 584864
4 MyApp 0x000d9d08 0x59000 + 527624
5 MyApp 0x000d9934 0x59000 + 526644
6 MyApp 0x000da6c6 0x59000 + 530118
7 MyApp 0x0005b1f0 0x59000 + 8688
8 MyApp 0x000660a4 0x59000 + 53412
9 UIKit 0x336130a0 0x33525000 + 975008
10 UIKit 0x33613052 0x33525000 + 974930
11 UIKit 0x33613030 0x33525000 + 974896
12 UIKit 0x336128e6 0x33525000 + 973030
13 UIKit 0x33612ddc 0x33525000 + 974300
14 UIKit 0x3353b5ec 0x33525000 + 91628
15 UIKit 0x335287fc 0x33525000 + 14332
16 UIKit 0x33528116 0x33525000 + 12566
17 GraphicsServices 0x382ab5a0 0x382a5000 + 26016
18 GraphicsServices 0x382ab1ce 0x382a5000 + 25038
19 CoreFoundation 0x3331c170 0x33285000 + 618864
20 CoreFoundation 0x3331c112 0x33285000 + 618770
21 CoreFoundation 0x3331af94 0x33285000 + 614292
22 CoreFoundation 0x3328deb8 0x33285000 + 36536
23 CoreFoundation 0x3328dd44 0x33285000 + 36164
24 GraphicsServices 0x382aa2e6 0x382a5000 + 21222
25 UIKit 0x3357c2f4 0x33525000 + 357108
26 MyApp 0x0005b012 0x59000 + 8210
27 MyApp 0x0005afc8 0x59000 + 8136
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x0000004e r1: 0x00000000 r2: 0x00000000 r3: 0x00000000
r4: 0x3b091bd0 r5: 0x2fda7c0c r6: 0x1cd560e0 r7: 0x2fda6734
r8: 0x00000000 r9: 0x2fda6764 r10: 0x1cd560e0 r11: 0x1cdac4d0
ip: 0x000e7c0d sp: 0x2fda672c lr: 0x34a384b7 pc: 0x000e7cac
cpsr: 0x60000010
我试过的东西:
现在很明显,用xcode 3.2.6我无法通过xcode运行并访问控制台以进一步调试我的IOS 6设备。所以我把这个项目发给了一个朋友(没有付费帐户,所以无法在设备上测试)谁确认它在xcode 4.5和模拟器6上工作。
因此,如果它在模拟器6和4.3上工作,为什么它不会在iOS 6设备上工作?我有点难倒....
玩耍(只是注释行出等),我认为这是在该行崩溃后:
appdelagate.session = [[FBSession aloc] init];
,但我发现它很难确定或有任何想法为什么。
想得到一些想法或帮助, 谢谢。
听起来就像你正在装备成为一个iOS开发者...购买OSX Lion来开发iOS 6。 – Daniel
告诉我一些关于它的信息。让我解释一下,我通常在家里有一个新的MacBook Pro,但是我在内陆澳大利亚工作了3个月,离家约12个小时,并没有带上它。大错。无论如何,有人问我是否会启动一个程序,并设法访问只能运行雪豹的硬件的Mac。我只需要能够在设备上测试,直到我可以回家。肯定有办法让这个工作,谢谢。 –