asihttprequest

ARC and ASIHTTPRequest

我怕爱的太早我们不能终老 提交于 2019-11-30 00:38:27
I have a strange problem. I use ASIHTTPRequest in a iOS 5 project with ARC enabled. Since ASIHTTPRequest does not support ARC I have disabled ARC on all individual ASIHTTPRequest files. However, when I'm trying to compile my project, xcode still believes that those files are ARC-enabled and it complains. Did I do anything wrong or is that a bug in xcode? Don't tell me to convert ASIHTTPRequest to ARC-compatible code with the refactor tool. I have tried to do that and xcode complains on that ARC is enabled on the project (?!?!). You typed -fno-ojbc-arc . The correct flag is -fno-objc-arc . I

Is it safe to still use ASIHTTPRequest?

亡梦爱人 提交于 2019-11-29 20:42:33
问题 Ben Copsey has abandoned ASIHTTPRequest. It has been announced almost two months ago but I just realized it. I'm in the middle of a project using it. It wouldn't be an huge problem for me to replace it with something else at this stage (everyone is talking about AFNetworking right now), but: If I can avoid replacing it it's better. I'd rather spend that time working on other things I'd like to support iOS < 4, but AFNetworking and LRResty are 4> only I also have a few other apps that heavily

Upload picture selected using UIImagePickerController

主宰稳场 提交于 2019-11-29 16:56:13
I'm trying to upload the picture selected using UIImagePickerController. The UIImagePickerController gives UIImage object that I can display in a view, but it doesn't give a path (may be it does and I'm looking at wrong place). I'm using ASIFormDataRequest to upload content, but this would need path to the picture to upload it. Any suggestion ? Thank you If you have UIImage with you than you don't need local path for image to upload, you can upload it using following code. NSData *imgData = UIImagePNGRepresentation(YourUIImageObject); NSURL *url = @"yourURL"; ASIFormDataRequest *currentRequest

Load HTTPS url in a UIWebView

戏子无情 提交于 2019-11-29 14:18:49
问题 I begin iPhone programming and I have big problem I cant resolve. So, I have a UIWebview , I can load HTTP url without problems : NSString urlAdress; urlAdress = @"http://servername"; NSURL *url = [NSURL URLWithString:urlAdress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; Its work, my page is load in my UIwebView, but when I replace : urlAdress = @"http://servername"; by urlAdress = @"https://servername"; I have blank screen. I read its

ASIHTTPRequest; installation issues

為{幸葍}努か 提交于 2019-11-29 10:32:50
I am trying to install ASIHTTPRequest and i am having issues with libxml/HTMLParser, xmlsave, xpath and xpathInternals are missing. I have already included the libxml2.2.7.3 framework and followed the guide on their website to the letter. any suggestions? You note that you've followed the instructions to the letter, though I don't see libz.1.2.3.dylib in your post or in your comments. Are you certain you have libz.1.2.3? Note that it is not the same as libbz2 or libxml2. If you filter by dylibs it's right near the bottom. Edited to add the real answer, as discovered through a lengthy back-and

iphone pdf download

北慕城南 提交于 2019-11-29 08:57:37
-(IBAction)click; { NSURL *url = [NSURL URLWithString:URL_TO_DOWNLOAD]; NSString *tempDownloadPath = [[self documentsDirectory] stringByAppendingPathComponent:@"test.pdf"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDownloadDestinationPath:[self documentsDirectory]]; [request setTemporaryFileDownloadPath:tempDownloadPath]; [request setDelegate:self]; [request startAsynchronous]; } - (void)requestFinished:(ASIHTTPRequest *)request { NSLog(@"requestFinished"); NSError *error; NSFileManager *fileManager = [[NSFileManager alloc] init]; NSLog(@"Documents directory: %

iPhone app, running http requests while application in background

浪子不回头ぞ 提交于 2019-11-29 05:23:25
In my iPhone app I would like to run several queries when the application is in background. I already use ASIHttpRequest to make the queries, that works fine but now I try to find a way to trigger them in background. In the app delegate, I have added a call to the method making the request: [self getItemsFromServer] getItemsFromServer runs an asynchronous request (on the simulator I saw the log of this methods once I get back the application to the foreground). How can I use some kind of timer to have this method ran every 10 minutes (I just need to run it 4 or 5 times, not each 10 minutes

Uploading images to server using ASIHTTPRequest in iphone

爷,独闯天下 提交于 2019-11-29 05:19:44
I have to upload images to server form iphone I am using ASIHTTPRequest for this. I have set a loop for uploading seven files. But after the executing only last file is uploaded can some one point out where I am getting it wrong. I am using the below code for uploading : for (int i=1; i<8; i++) { NSString* filename = [NSString stringWithFormat:@"Photo%d.jpg", i]; NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:filename]; [request setFile:path forKey:[NSString stringWithFormat:@"file"]]; } [request startAsynchronous]; [resultView

How to upload image that was taken from UIImagePickerController

◇◆丶佛笑我妖孽 提交于 2019-11-29 04:47:01
After user choose image from the iPhone library with UIImagePickerController , I want to upload it to my server using ASIHTTPRequest library. I know that with ASIHTTPRequest I can upload a file with the file's URl, but how do I get the image URL? I know I can get the image UIImagePickerControllerReferenceURL , that look like this: "assets-library://asset/asset.JPG?id=F2829B2E-6C6B-4569-932E-7DB03FBF7763&ext=JPG" is this the URL I need to use? There are two ways 1: You can upload the image using the imagePickerController delegate - (void)imagePickerController:(UIImagePickerController *)picker

Is calling -[NSRunLoop runUntilDate:] a good idea?

强颜欢笑 提交于 2019-11-29 04:04:55
Is it generally a good idea to call -[NSRunLoop runUntilDate:] ? It seems to work without any issues, but it makes me nervous to tell the run loop to run from within the run loop. More info: I have a project right now that is fetching data from a REST service. One critical piece of information that needs to be obtained is the range of dates with valid data. It's a very small bit of data that only needs to be gotten once, so I decided that the best way to handle it is to have the property download the data if the local variable is nil . I'm using ASIHTTPRequest and an ASINetworkQueue , so