Created
July 10, 2012 11:15
-
-
Save ppworks/3082720 to your computer and use it in GitHub Desktop.
まじで断片ですまぬ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
if (self.item_page == 1 && !JSON) { | |
[UIUtilitiy hideActivityIndicator]; | |
[UIUtilitiy showAlert:@"error" text:@"見つかりませんでした"]; | |
return; | |
} | |
if (JSON) { | |
[self.items addObjectsFromArray:[[[NSMutableArray alloc]initWithArray:JSON]autorelease]]; | |
self.not_found = NO; | |
} else { | |
self.not_found = YES; | |
} | |
[self.tableView reloadData]; | |
[UIUtilitiy hideActivityIndicator]; | |
} failure:nil]; | |
[operation start]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment