ブロック内のNSStringに値を設定する際に問題があります。ブロック内のNSStringの値を詰めます。
__block NSString *cityID = [[NSString alloc] init];
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id json) {
cityID = [NSString stringWithFormat:@"%@",[[json valueForKeyPath:@"location"] valueForKey:@"id"]];
NSLog(@"city id for 621352674 = %@",cityID);
} failure:nil];
[operation start];
NSLog(@"city id for 621352674 = %@",cityID);
最初NSLogは私にcityIDの正しい値を示します。しかし、2番目には何も見えません。どのようにこの問題をixにするのですか?
[ブロックのint値を変更する方法](http://stackoverflow.com/questions/9997489/)ブロック内の値の変更方法) –