Merge pull request #594 from ijohn/patch-1
Update Example/Classes/Models/Post.m
This commit is contained in:
commit
21c1006761
1 changed files with 3 additions and 2 deletions
|
|
@ -48,8 +48,9 @@
|
|||
|
||||
+ (void)globalTimelinePostsWithBlock:(void (^)(NSArray *posts, NSError *error))block {
|
||||
[[AFAppDotNetAPIClient sharedClient] getPath:@"stream/0/posts/stream/global" parameters:nil success:^(AFHTTPRequestOperation *operation, id JSON) {
|
||||
NSMutableArray *mutablePosts = [NSMutableArray arrayWithCapacity:[JSON count]];
|
||||
for (NSDictionary *attributes in JSON) {
|
||||
NSArray *postsFromResponse = [JSON valueForKeyPath:@"data"];
|
||||
NSMutableArray *mutablePosts = [NSMutableArray arrayWithCapacity:[postsFromResponse count]];
|
||||
for (NSDictionary *attributes in postsFromResponse) {
|
||||
Post *post = [[Post alloc] initWithAttributes:attributes];
|
||||
[mutablePosts addObject:post];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue