Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #594 from ijohn/patch-1
Browse files Browse the repository at this point in the history
Update Example/Classes/Models/Post.m
  • Loading branch information
mattt committed Oct 24, 2012
2 parents 4f844a2 + 8f898ad commit 21c1006
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Example/Classes/Models/Post.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ - (id)initWithAttributes:(NSDictionary *)attributes {

+ (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];
}
Expand Down

0 comments on commit 21c1006

Please sign in to comment.