NSURL *URL = [NSURL URLWithString:@"http://example.com"];
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:URL];
[manager GET:@"/resources" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
[resources addObjectsFromArray:responseObject[@"resources"]];
[manager SUBSCRIBE:@"/resources" usingBlock:^(NSArray *operations, NSError *error) {
for (AFJSONPatchOperation *operation in operations) {
switch (operation.type) {
case AFJSONAddOperationType:
[resources addObject:operation.value];
break;
default:
break;
}
}
} error:nil];
} failure:nil];
=======>
Link of Reference:
http://nshipster.com/afnetworking-2/
===> Class Of AFnetworking:-
https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-2.0-Migration-Guide
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:URL];
[manager GET:@"/resources" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
[resources addObjectsFromArray:responseObject[@"resources"]];
[manager SUBSCRIBE:@"/resources" usingBlock:^(NSArray *operations, NSError *error) {
for (AFJSONPatchOperation *operation in operations) {
switch (operation.type) {
case AFJSONAddOperationType:
[resources addObject:operation.value];
break;
default:
break;
}
}
} error:nil];
} failure:nil];
=======>
Link of Reference:
http://nshipster.com/afnetworking-2/
===> Class Of AFnetworking:-
https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-2.0-Migration-Guide