ios - 在 Objective-C 中使用 InstagramKit 的问题

标签 ios objective-c instagram

我正在尝试使用 InstagramKit ( https://github.com/shyambhat/InstagramKit ) 构建一个简单的应用程序来帮助我学习 objective-c。

我收到以下错误:

2015-01-17 08:20:06.168 test[709:6529] *** Assertion failure in -[InstagramEngine init], /MY_FOLDER/test/InstagramKit/InstagramKit/Engine/InstagramEngine.m:146
2015-01-17 08:20:06.170 test[709:6529] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid Instagram Client ID.'
*** First throw call stack: (   
0   CoreFoundation      0x000000010e1a9f35 __exceptionPreprocess + 165  
1   libobjc.A.dylib     0x000000010de42bb7 objc_exception_throw + 45    
2   CoreFoundation      0x000000010e1a9d9a +[NSException raise:format:arguments:] + 106     
3   Foundation          0x000000010da5f5df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195    
4   test                0x000000010c0b2bfd -[InstagramEngine init] + 2237
5   test                0x000000010c0b2162 __31+[InstagramEngine sharedEngine]_block_invoke + 50
6   libdispatch.dylib   0x000000010eaaf7f4 _dispatch_client_callout + 8     
7   libdispatch.dylib   0x000000010ea9c343 dispatch_once_f + 565
8   test                0x000000010c0b2109 +[InstagramEngine sharedEngine] + 89     
9   test

...

不确定我做错了什么。

这是我试过的简单代码。

MyViewController.m:

- (void)viewDidLoad
{

    NSMutableArray *items = [NSMutableArray array];
    [super viewDidLoad];

    [[InstagramEngine sharedEngine] getMediaWithTagName:tag count:15 maxId:self.currentPaginationInfo.nextMaxId withSuccess:^(NSArray *media, InstagramPaginationInfo *paginationInfo) {
        self.currentPaginationInfo = paginationInfo;
        [items addObjectsFromArray:media];
    } failure:^(NSError *error) {
        NSLog(@"Search Media Failed");
    }];

}

===================

InstagramEngine.m:

NSString *const kInstagramKitAppClientIdConfigurationKey = @"MY_CLIENT_ID"; //@"InstagramKitAppClientId";
NSString *const kInstagramKitAppRedirectUrlConfigurationKey = @"MY_REDIRECT_URL"; //@"InstagramKitAppRedirectURL";

最佳答案

您似乎没有提供您的客户 ID。您需要使用您的值更新 InstagramKit.plist 中的 InstagramKitAppClientId 和 InstagramKitAppRedirectURL 设置。

关于ios - 在 Objective-C 中使用 InstagramKit 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27999954/

相关文章:

iOS 反向地理编码问题不返回 placemark.locality 的值

objective-c - 没有 UIPrintInteractionController 的打印

iphone - 将字符串转换为时间(不是日期)

Python 通过请求更改 Instagram 个人资料图片

ASP.NET 与 Instagram 身份验证

ios - 对Casting的不完全理解

ios - 阴影不符合 UITableViewCell 中 View 的形状

javascript - 在哪里可以找到图像的 Instagram 媒体 ID(具有访问 token 并关注图像所有者)?

ios - 我们可以在iOS应用中同时使用核心数据和SQlite吗

objective-c - 以编程方式将按钮添加到导航栏