我正在开发一个集成了天空驱动框架的应用程序。但是当我尝试登录时,我的应用程序崩溃了。
这是我的代码
(IBAction)signInMethod:(id)sender { self.liveClient =
[[LiveConnectClient alloc] initWithClientId:APP_CLIENT_ID
delegate:self
userState:@"initialize"]; }
- (void)authCompleted:(LiveConnectSessionStatus) status
session:(LiveConnectSession *) session
userState:(id) userState { if ([userState isEqual:@"initialize"]) {
NSLog(@"initialized");
[self.liveClient login:self
scopes:[NSArray arrayWithObjects:@"wl.signin", nil]
delegate:self
userState:@"signin"];
} if ([userState isEqual:@"signin"]) {
if (session != nil)
{
NSLog(@"signed in");
}
} }
- (void)authFailed:(NSError *) error
userState:(id)userState { NSLog(@"%@",[NSString stringWithFormat:@"Error: %@", [error localizedDescription]]); //
[self.infoLabel setText:[NSString stringWithFormat:@"Error: %@",
[error localizedDescription]]]; }
编辑
现在我可以登录了。我收到错误是因为我没有正确集成框架。