asihttprequest

OK to retain ASIHTTPRequest delegate?

让人想犯罪 __ 提交于 2019-12-04 05:41:35
问题 Is it OK to retain a delegate of a subclass of ASIHTTPRequest ? I made a subclass of ASIHTTPRequest called JSONRequest . Each instance of JSONRequest is its own delegate, handles the callbacks, and passes them on to jsonDelegate , which is a private property of JSONRequest , and responds to requestFinished:withResult: , where result is an NSDictionary representation of the JSON response. To do this, I overloaded setDelegate: in JSONRequest to do super.delegate = self; self.jsonDelegate =

Parse JSON data using Asihttprequest and the Json framework for iphone

笑着哭i 提交于 2019-12-03 20:43:17
I've been learning how to parse JSON using the JSON framework and ASIHTTPRequest for iOS. I've tested using twitter feeds and also a custom feed through a community tutorial. All is going well. I then thought I'll test using the Microsoft Odata Service for Northwind db. You can view the json results here: http://jsonviewer.stack.hu/#http://services.odata.org/Northwind/Northwind.svc/Products%281%29?$format=json Now I've struggling to work out how to parse just the product name. Can anyone point me in the right direction? On my requestFinished i have this : - (void)requestFinished:

'kCFStreamSSLAllowsExpiredCertificates' and 'kCFStreamSSLAllowsAnyRoot' is deprecated

北城以北 提交于 2019-12-03 12:35:21
I have added the "ASIHTTPRequest" library to my app. Now, I'm trying to remove all warnings in my project. I have fixed all other warnings except those for "ASIHTTPRequest". I'm getting the warnings below. 'kCFStreamSSLAllowsExpiredCertificates' is deprecated: 'kCFStreamSSLAllowsAnyRoot' is deprecated: How to resolve this? Code: NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates, [NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot, [NSNumber numberWithBool:NO],

Incorrect NSStringEncoding value 0x0000 detected (using ASIHTTPRequest)

放肆的年华 提交于 2019-12-03 12:24:50
I'm using ASIHTTPRequst in my application and im having some problems, but only on certain devices. In some cases i get the following error: " Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future " I got limited options for testing this out, because it works on all my internal test devices, but the problem still occurs on one or more of my clients test phones. It may also be a case when the phone is connected to the cellular network, as it seems to be working on wifi. Does anyone know what might cause

ASIHTTPRequest for dummies

▼魔方 西西 提交于 2019-12-03 08:21:56
I'm a COMPLETE DUMMY in ASIHTTPRequest. I have just downloaded the library and added it to my project and now i'm trying to understand basics of working with it. I've found some pretty good example here this little tutorial is about uploading images to a server. I tried it and things seem to work (but i'm confused with NSString returned by [request responseString], it returned HTML code of a whole web page ) but i would like to know how to download images (or anything uploaded) back from the server. After searching a bit i found this and it gave me no answers but more questions only, cause it

Generic approach to NSManagedObjectContext in multi-threaded application

拈花ヽ惹草 提交于 2019-12-03 06:01:16
问题 I've read a number of posts here about NSManagedObjectContext and multi-threaded applications. I've also gone over the CoreDataBooks example to understand how separate threads require their own NSManagedObjectContext, and how a save operation gets merged with the main NSManagedObjectContext. I found the example to be good, but also too application specific. I'm trying to generalize this, and wonder if my approach is sound. My approach is to have a generic function for fetching the

ASIHTTP: Upload UIImage?

人盡茶涼 提交于 2019-12-03 04:38:40
问题 Can someone please tell me how I can use an ASIHTTPRequest object in Objective-c to upload an UIImage object? Do I need to convert it to an NSData object? (This is for an avatar upload url) E.g. UIImage *toUpload = [UIImage imageNamed:@"test.jpg"] URL: "http://www.example.com/api/users/avatar/upload?access_token=12345" RequestType: PUT 回答1: Heres an example using ASIFormRequest that will also attempt to compress the image to given maximum size //Compress the image CGFloat compression = 0.9f;

How to Pause and Resume Downloading Files with ASIHTTP Request in iPhone

不想你离开。 提交于 2019-12-03 04:05:42
I m using ASIHTTP Request sample source code for downloading urls. My question is that how to pause and resume the downloading files. Please Help. Deprecation Notice ASIHTTP was deprecated around 2011, if you want network connectivity now, you should look up AFNetworking for ObjC or Alamofire for Swift , or stick to the native support: For native support, in iOS 7 Apple added the NSURLSession , which can start download tasks ( NSURLSessionDownloadTask ), and these can be cancelled and restarted, check the method downloadTaskWithResumeData(_:) from NSURLSession , that has a very good

iPhone ASIHTTP - Distinguishing between API calls?

强颜欢笑 提交于 2019-12-03 03:44:55
I currently have a view controller that implements ASIHTTP for handling API calls. My view controller fires 2 separate calls. I need to be able to distinguish between the 2 calls in the -requestFinished(ASIHTTPRequest*)request method, so I can parse each one accordingly... Is there any of doing this? Use the userInfo field! That's what it's for! An ASIHTTPRequest (or an ASIFormDataRequest) object has a property called .userInfo that can take an NSDictionary with anything in it you want. So I pretty much always go: - (void) viewDidLoad { // or wherever ASIHTTPRequest *req = [ASIHTTPRequest

asihttprequest crashes my app

蹲街弑〆低调 提交于 2019-12-03 03:04:53
I have a navigation based app. Press a button on main view, then I push a new view to the navigation controller. All pretty basic stuff. When the new view is loaded, I do an ASIHTTPRequest to fetch some json data, which is a list of image urls. Then I do a for loop, create a bunch of ASIHTTPRequests, add them to a queue and then run the queue. But if I click on the back button before the queue is finished, the app crashes, this app displays houses and lets say you pick the wrong house, click back very quickly, before any photo is displayed, bumm crash. This thread http://groups.google.com