diff --git a/Example/Classes/Models/Post.m b/Example/Classes/Models/Post.m index c45c03d..2514a58 100644 --- a/Example/Classes/Models/Post.m +++ b/Example/Classes/Models/Post.m @@ -48,7 +48,8 @@ + (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]]; + NSArray *postsFromResponse = [JSON valueForKeyPath:@"data"]; + NSMutableArray *mutablePosts = [NSMutableArray arrayWithCapacity:[postsFromResponse count]]; for (NSDictionary *attributes in JSON) { Post *post = [[Post alloc] initWithAttributes:attributes]; [mutablePosts addObject:post];