Update Example/Classes/Models/Post.m
Adapt to app.net global stream response change
This commit is contained in:
parent
4f844a2c3d
commit
3a80dbc795
1 changed files with 2 additions and 1 deletions
|
|
@ -48,7 +48,8 @@
|
||||||
|
|
||||||
+ (void)globalTimelinePostsWithBlock:(void (^)(NSArray *posts, NSError *error))block {
|
+ (void)globalTimelinePostsWithBlock:(void (^)(NSArray *posts, NSError *error))block {
|
||||||
[[AFAppDotNetAPIClient sharedClient] getPath:@"stream/0/posts/stream/global" parameters:nil success:^(AFHTTPRequestOperation *operation, id JSON) {
|
[[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) {
|
for (NSDictionary *attributes in JSON) {
|
||||||
Post *post = [[Post alloc] initWithAttributes:attributes];
|
Post *post = [[Post alloc] initWithAttributes:attributes];
|
||||||
[mutablePosts addObject:post];
|
[mutablePosts addObject:post];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue