Skip to content

Commit 3a80dbc

Browse files
committed
Update Example/Classes/Models/Post.m
Adapt to app.net global stream response change
1 parent 4f844a2 commit 3a80dbc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Example/Classes/Models/Post.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ - (id)initWithAttributes:(NSDictionary *)attributes {
4848

4949
+ (void)globalTimelinePostsWithBlock:(void (^)(NSArray *posts, NSError *error))block {
5050
[[AFAppDotNetAPIClient sharedClient] getPath:@"stream/0/posts/stream/global" parameters:nil success:^(AFHTTPRequestOperation *operation, id JSON) {
51-
NSMutableArray *mutablePosts = [NSMutableArray arrayWithCapacity:[JSON count]];
51+
NSArray *postsFromResponse = [JSON valueForKeyPath:@"data"];
52+
NSMutableArray *mutablePosts = [NSMutableArray arrayWithCapacity:[postsFromResponse count]];
5253
for (NSDictionary *attributes in JSON) {
5354
Post *post = [[Post alloc] initWithAttributes:attributes];
5455
[mutablePosts addObject:post];

0 commit comments

Comments
 (0)