내 응용 프로그램이 오류를 얻고있다오류 새로 고침 트위터 트윗
- (void)fetchInstagramPics {
instaPics = [[NSMutableArray alloc] init];
NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
BOOL *status = [user boolForKey:@"isInstagramLoggedIn"];
if (status) {
[[InstagramClient sharedClient] getPath:@"users/self/feed"
parameters:nil
success:^(AFHTTPRequestOperation *operation, id responseObject) {
// NSLog(@"Response: %@", responseObject);
self.timelineResponse = [responseObject mutableCopy];
[self.instaPics addObjectsFromArray:responseObject[@"data"]];
[self updateArrays];
[self.tableView reloadData];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Failure: %@", error);
}];
}
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData]; });
}
- (void)updateArrays {
instaPics = self.timelineResponse[@"data"];
totalFeed = [tweets arrayByAddingObjectsFromArray:instaPics];
}
- (void)fetchTimeline {
[self fetchInstagramPics];
[self fetchTweetsAuth];
[self updateArrays];
[self.tableView reloadData];
}
- (void)refetchTimeline {
[self fetchInstagramPics];
[self fetchTweets];
[self updateArrays];
[self.tableView reloadData];
}
- (void)fetchTweetsAuth {
self.twitterClient = [[AFOAuth1Client alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.twitter.com/1.1/"] key:@"4oFCF0AjP4PQDUaCh5RQ" secret:@"NxAihESVsdUXSUxtHrml2VBHA0xKofYKmmGS01KaSs"];
[self.twitterClient authorizeUsingOAuthWithRequestTokenPath:@"/oauth/request_token" userAuthorizationPath:@"/oauth/authorize" callbackURL:[NSURL URLWithString:@"floadt://success"] accessTokenPath:@"/oauth/access_token" accessMethod:@"POST" scope:nil success:^(AFOAuth1Token *accessToken, id responseObject) {
[self.twitterClient registerHTTPOperationClass:[AFJSONRequestOperation class]];
[self.twitterClient getPath:@"statuses/home_timeline.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSArray *responseArray = (NSArray *)responseObject;
[responseArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSLog(@"Success: %@", obj);
tweets = responseArray;
}];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
} failure:^(NSError *error) {
NSLog(@"Error: %@", error);
}];
}
- (void)fetchTweets{
[self.twitterClient registerHTTPOperationClass:[AFJSONRequestOperation class]];
[self.twitterClient getPath:@"statuses/home_timeline.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSArray *responseArray = (NSArray *)responseObject;
[responseArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSLog(@"Success: %@", obj);
tweets = [tweets copy];
tweets = responseArray;
}];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
}
- (void)refresh:(UIRefreshControl *)refreshControl {
[self refetchTimeline];
[refreshControl endRefreshing];
}
tweets
배열라는 배열 아래에있는 instaPics
배열과 공유 totalArray
그래서 내가 fetchInstagramPics
함수를 포함 시켰습니다. 나는 그것이 복잡하게 들리지만, 귀하의 도움은 깊이 감사하게 생각합니다. 여기
STACK TRACE :
(
0 CoreFoundation 0x02b6b5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x027978b6 objc_exception_throw + 44
2 CoreFoundation 0x02b6b3bb +[NSException raise:format:] + 139
3 CoreFoundation 0x02bf2365 -[__NSCFArray insertObject:atIndex:] + 101
4 CoreFoundation 0x02b2f2d0 -[NSMutableArray insertObjects:count:atIndex:] + 208
5 CoreFoundation 0x02b2ef69 -[NSMutableArray insertObjectsFromArray:range:atIndex:] + 425
6 CoreFoundation 0x02b2ed15 -[NSMutableArray addObjectsFromArray:] + 661
7 MyApp 0x0003c6c6 __42-[StreamViewController fetchInstagramPics]_block_invoke + 278
8 MyApp 0x0001e73b __64-[AFJSONRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke91 + 43
9 libdispatch.dylib 0x035187f8 _dispatch_call_block_and_release + 15
10 libdispatch.dylib 0x0352d4b0 _dispatch_client_callout + 14
11 libdispatch.dylib 0x0351b75e _dispatch_main_queue_callback_4CF + 340
12 CoreFoundation 0x02bd0a5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
13 CoreFoundation 0x02b116bb __CFRunLoopRun + 1963
14 CoreFoundation 0x02b10ac3 CFRunLoopRunSpecific + 467
15 CoreFoundation 0x02b108db CFRunLoopRunInMode + 123
16 GraphicsServices 0x045309e2 GSEventRunModal + 192
17 GraphicsServices 0x04530809 GSEventRun + 104
18 UIKit 0x0192ad3b UIApplicationMain + 1225
19 MyApp 0x00062b1d main + 141
20 libdyld.dylib 0x037bf70d start + 1
)
나는 대답을 –