SoundCloud iOS 启动教程 - 无法识别的选择器

问题描述 投票:0回答:1

我正在遵循 iOS 快速入门教程,并且已经创建了登录 SoundCloud 的按钮,但我收到此错误:

2013-05-01 15:00:44.698 SoundCloudSample[60999:c07] +[SCSoundCloud shared]: unrecognized selector sent to class 0x3a568
2013-05-01 15:00:44.701 SoundCloudSample[60999:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SCSoundCloud shared]: unrecognized selector sent to class 0x3a568'
*** First throw call stack:
(0x192a012 0x174fe7e 0x19b52ad 0x1919bbc 0x191994e 0x2ad0 0x17507cf 0x1757a0d 0x174eaeb 0x174ee22 0x17610e1 0x1763705 0x8c02c0 0x8c0258 0x981021 0x98157f 0x9806e8 0x8efcef 0x8eff02 0x8cdd4a 0x8bf698 0x1da7df9 0x1da7ad0 0x189fbf5 0x189f962 0x18d0bb6 0x18cff44 0x18cfe1b 0x1da67e3 0x1da6668 0x8bcffc 0x1f0d 0x1e35)
libc++abi.dylib: terminate called throwing an exception
(lldb) 
- (IBAction) login:(id)sender {

SCLoginViewControllerCompletionHandler handler = ^(NSError *error) {
    if (SC_CANCELED(error)) {
        NSLog(@"Canceled!");
    } else if (error) {
        NSLog(@"Error: %@ ", [error localizedDescription]);
    } else {
        NSLog(@"Done");
    }
};
[SCSoundCloud requestAccessWithPreparedAuthorizationURLHandler:^(NSURL *preparedURL){
    SCLoginViewController *loginViewController;
    loginViewController = [SCLoginViewController loginViewControllerWithPreparedURL:preparedURL completionHandler:handler];
    [self presentModalViewController:loginViewController animated:YES];
}];
 
}

自从我遵循教程以来,我不确定自己到底做错了什么。

我也对 client_id、secret 和重定向 URI 感到困惑。

这是代码:

- (void) initialize {
[SCSoundCloud setClientID:@"98e77c3e4da0cc49f2f8e58f278bb813" secret:@"b8311d06a82a8c824b64b8a719479cda" redirectURL:[NSURL URLWithString:@"http://soundcloud.com/connect?client_id=98e77c3e4da0cc49f2f8e58f278bb813&redirect_uri=evesdropmusic://oauth"]];
}

也许我忽略了一些事情......

ios xcode soundcloud
1个回答
2
投票

我已经找到问题的解决方案了!

显然我认为我在最新版本的 XCode 中发现了一个错误。

在目标部分下的“其他链接器标志”上——构建设置,我发现即使我输入了“-ObjC,-all_load”,XCode 也决定不保存这些凭据。

解决方法是使用 (+) 输入标志 - 再次单击它们,然后如果它们消失,请再次输入。应该可以节省这个时间。有时这不会发生。我不确定为什么我的条目没有保留。

当我再次添加这些后,问题就解决了。

© www.soinside.com 2019 - 2024. All rights reserved.