私はこのTwitter APIのものを試してきましたが、本当に混乱しています...
次のコードで EXC_BAD_ACCESS の不正なアクセスが発生し続けます...ここで何が問題なのですか?
NSURL *followingURL = [NSURL URLWithString:@"https://api.twitter.com/1/users/lookup.json"];
// Pass in the parameters (basically '.ids.json?screen_name=[screen_name]')
id fromIntToNum = [NSNumber numberWithInteger: friID];
NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:@"159462573", @"user_id", nil];
// Setup the request
twitterRequest = [[TWRequest alloc] initWithURL:followingURL
parameters:parameters
requestMethod:TWRequestMethodGET];
// This is important! Set the account for the request so we can do an authenticated request. Without this you cannot get the followers for private accounts and Twitter may also return an error if you're doing too many requests
[twitterRequest setAccount:theAccount];
// Perform the request for Twitter friends
[twitterRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
if (error) {
/*
// deal with any errors - keep in mind, though you may receive a valid response that contains an error, so you may want to look at the response and ensure no 'error:' key is present in the dictionary
NSLog(@"%@",error);*/
} else {
/*NSError *jsonError = nil;
// Convert the response into a dictionary
NSDictionary *twitterGrabbedUserInfo = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONWritingPrettyPrinted error:&jsonError];
// Grab the Ids that Twitter returned and add them to the dictionary we created earlier
NSLog(@"%@", [twitterGrabbedUserInfo objectForKey:@"screen_name"]);*/
}
}];
コードが失敗する行を区切りました...
この Twitter API の問題の原因は何ですか?
次の行はクラッシュを引き起こします:::
[twitterRequest performRequestWithHandler:^(NSData *responseData,
NSHTTPURLResponse *urlResponse, NSError *error) {
また、時々このエラーが発生します:
[__NSCFNumber credentialForAccount:]: unrecognized
更新: ハンドラーをコメントアウトし、TwitterRequest と ivar を作成しましたが、それでもクラッシュします...