afnetworking

AFNetworking 2.0 “_NSURLSessionTransferSizeUnknown” linking error on Mac OS X 10.8

心已入冬 提交于 2019-12-13 04:34:20
问题 I'm using AFNetworking 2.0 Mac OS X 10.8.0 Xcode 5 But I'm receiving the following error: Undefined symbols for architecture x86_64: "_NSURLSessionTransferSizeUnknown", referenced from: -[AFURLSessionManagerTaskDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:] in AFURLSessionManager-C493EEE75215474B.o -[AFURLSessionManager uploadTaskWithTask:progress:completionHandler:] in AFURLSessionManager-C493EEE75215474B.o ld: symbol(s) not found for architecture x86_64

Multiple async request to create a dynamic table view in objective c

半世苍凉 提交于 2019-12-13 04:28:50
问题 I am developing a new iOS app. In this app, I have a slide menu. I want to create this menu dynamically with async requests. It's a kind of new LinkedIn menu like this one : Linkedin Menu This menu updates one of the rows of the table view automatically every ten seconds (or less) and in other row you have some of your profile information (name , picture...) and also you can update messages and notification icons. I would like to know how to manage all of these requests at the same time. I am

App freezes after deleting UITableViewCell

流过昼夜 提交于 2019-12-13 02:18:48
问题 There is a problem when I try to delete UITableViewCell in success block of the request. In my - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath I am making request with AFNetworking - (NSURLSessionDataTask *)POST:(NSString *)URLString parameters:(id)parameters success:(void (^)(NSURLSessionDataTask *task, id responseObject))success failure:(void (^)(NSURLSessionDataTask *task, NSError *error)

AFHTTPSessionManager block is not called when app is on background

Deadly 提交于 2019-12-13 01:37:26
问题 My app get a silent push, then do some http request in background using AFNetworking,but it didn't enter the complete block, code is: AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] init]; [manager GET:urlString parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { NSLog(@"response objece:%@", responseObject); } failure:^(NSURLSessionDataTask *task, NSError *error) { NSLog(@"error:%@", error); }]; then I found maybe I could use NSURLSessionConfiguration to

AFNetworking 2.x POST request with xml body

做~自己de王妃 提交于 2019-12-13 01:17:24
问题 I am trying to POST some data to the server with body formatted as XML. [[HttpClientXML sharedClientWithBaseUrl:self.baseUrl] POST:@"/postXml/" parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) { BSLog(@"Success"); } failure:^(NSURLSessionDataTask *task, NSError *error) { BSLog(@"Error: %@",error.localizedDescription); }]; POST body xml content looks smth. like that: <action name='job'>jobName</action> HttpClientXML has this definitions: self.responseSerializer =

Returning response in AFNETWORKING

余生颓废 提交于 2019-12-12 21:36:26
问题 I am following this tutorial to learn AfNetworking in IOS And I am using the following function to get the response from the server: { // 1 NSString *weatherUrl = [NSString stringWithFormat:@"%@weather.php?format=json", BaseURLString]; NSURL *url = [NSURL URLWithString:weatherUrl]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; // 2 AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request // 3 success:^(NSURLRequest *request,

AFNetworking base64 parameter, characters being escaped by NSJSONSerialization

℡╲_俬逩灬. 提交于 2019-12-12 21:22:51
问题 I am attempting to submit an image to CardShark's API using AFNetworking. NSData *imageData = UIImageJPEGRepresentation(cardImage, 1.0); NSDictionary *parameters = @{@"front" : [imageData base64EncodedStringWithSeparateLines:NO]}; NSString *path = [NSString stringWithFormat:@"cardShark?webhookUrl=%@&apiKey=%@", kCardSharkWebHookURLEncodedString, kCardSharkAPIKey]; [self postPath:path parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { completion

Cache Facebook Profile Picture iOS

大兔子大兔子 提交于 2019-12-12 19:19:33
问题 I'm saving images to disk for my app users, who either upload a picture or connect with facebook and we display their profile picture. This works great, but if a user changes their facebook profile picture, the code below never updates the image. How can I check the facebook graph api to check if the image has been uploaded without redownloading the image? I am using AFNetworking so checking the 302 header is an option if its possible-just not sure how to implement. //load image if exists on

How to load image asynchronously using UIImageView+AFNetworking in ios

有些话、适合烂在心里 提交于 2019-12-12 18:41:47
问题 I am using this: UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString:@"http://oldmaker.com/glamberry_v2/ios_Loading-Spinners.gif"]]]; but this is taking too much time. I want to use AFNetworking to make loading speed faster. Any help would be appreciated. 回答1: You can use SDWebImage It supports asynchronous downloading as well as caching. Usage Just #import the UIImageView+WebCache.h header [imgView sd_setImageWithURL:Url_Of_The_Image placeholderImage:

Upload Using AFNetworking

牧云@^-^@ 提交于 2019-12-12 18:05:46
问题 NSURL *url = [NSURL URLWithString:@"http://127.0.0.1:8000/photo/"]; AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url]; NSDictionary *headers = [NSDictionary dictionaryWithObject:data forKey:@"attachment"]; //NSLog(@"strimng"); NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST" path:@"upload/" parameters:nil constructingBodyWithBlock: ^(id<AFMultipartFormData> formData) { NSLog(@"strimng"); [formData appendPartWithFileData:data name:@