asihttprequest

ASIHTTPRequest and background download

陌路散爱 提交于 2019-12-08 02:50:14
问题 I was planning to use ASIHttprequest to download an mp3 file. i will need to use queues because there can be multiple simultaneous downloads. I saw that you can use [request setShouldContinueWhenAppEntersBackground:YES]; if you want to support background execution... If the file completes in the background, how can i handle this? will the delegates be called anyway? can i make one of those notification badges from the delegate if the app was in background whenn the delegate was called? PS: I

ASIHTTPRequest UIWebView load documents

假如想象 提交于 2019-12-08 02:04:27
问题 What is the best way to view documents (pdf,doc,xls) using AsiHttpRequest and UIWebView??? I tried the following, but the UIWebView is displaying the html: NSString * baseURL = @"http://xxxxxx/open-api/v1/"; NSString * itemRef = @"item/133/attachment/test.pdf"; NSString *urlString = [NSString stringWithFormat:@"%@%@", baseURL, itemRef]; NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setUsername:@"xx"]; [request setPassword

UISearchDisplayController - wait for N seconds OR for user to press “Search” before conducting search

点点圈 提交于 2019-12-08 01:20:22
问题 I have a UISearchDisplayController that I am currently regretting implementing. The problem is that my search controller accesses a web service and then updates a UITableView by calling [tableView reloadData] . Every time a user enters a key, it searches. I've been able to partially relieve the symptoms by requiring at least three characters before calling the ASIHTTPRequest but there must be a better way. Basically I want the UISearchDisplayController to wait for N seconds OR for the user to

ASIHTTPRequest crashes the app on ios8

孤人 提交于 2019-12-08 01:17:56
问题 Here I am using JSON to parse the data with ASIHTTPRequest The same code is working fine for my lower version of iOS. (iOs7 & below) But I am not able to run this on my iOS-8 device. The log is getting well, but the app crashes, may be getting late reply from server. It should not crash for late reply. Does any new modification required for iOS-8 for ASIHTTPRequest ? Same code for lower version working well. If I tried to check with debugger ON with each method, I found my code is crashing

iPhone ASIFormDataRequest with multipart/form-data

孤街浪徒 提交于 2019-12-08 01:01:30
问题 as I have read in the ASI Documentation, its writen: "Data is posted in 'application/x-www-form-urlencoded' format, or 'multipart/form-data' format when uploading binary data or files." That's exactly my Problem. I am sending just a String to a server, but the server just accepts 'multipart/form-data' and as I just send a String, the ASI Framework creates a POST request with 'application/x-www-form-urlencoded' format automatically, cause I am not sending any binary data or file. Result: the

Why is NSTimer blocked while another thread is running?

≡放荡痞女 提交于 2019-12-07 16:48:18
问题 I'm trying to run a lenghty task in the background on the iPhone. I start it with performSelectorInBackground . I also create a NSTimer on the main thread just to check if things are working. I expected that the timer would run while the other thread does it's thing: - (void)viewDidLoad { [super viewDidLoad]; [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(onTimerEvent:) userInfo:nil repeats:YES]; [self performSelectorInBackground:@selector(lengthyMethod) withObject

Posting picture on Facebook 'feed' from an iPhone app

冷暖自知 提交于 2019-12-07 15:52:13
问题 I am using ASIHTTPRequest to work on Facebook graph API. This is the nearest I have gone to posting a picture on the feed. So if I have a ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; The url is https://graph.facebook.com/me/feed Now to post a picture I do the following: [request setPostValue:@"My Message" forKey:@"message"]; [request setPostValue:@"somepic.png" forKey:@"picture"]; [request setPostValue:@"Some Name" forKey:@"name"]; [request setPostValue:@"Some

About solution of offline mode for online HTML5 video system

£可爱£侵袭症+ 提交于 2019-12-07 15:48:50
问题 We have online website system with a lot of feature such as playback video etc. The purpose is that we want to make offline mode application for the iPad with UIWebView support. Two choices: Use HTML5 manifest to implement offline mode , here Download all content of HTML/JavaScripts/CSS and resources such as images/videos, then use UIWebView to load the HTML file For the solution 1, after searching we found a lot of problems such as cache limitation, not clear answer , 5MB ? 50 MB ? hard to

ASIHttpRequest send a weired status code of zero. Not reaching the server

对着背影说爱祢 提交于 2019-12-07 07:41:59
问题 I use ASIHTTPRequest framework in my iPhone application to manage the HTTP communication. I followed their examples given in the project home page to send asynchronous requests. There we have to implement two callbacks, one for requestFinish and other for requestFailed. However, 60% of the time requests sent by the iPhone ends up in the "requestFinish" callback method and gives a valid HTTP status code. But sometimes it goes to "requestFailed" callback and the status code become '0' which is

Sending AVAudioRecorder to server iOS

喜夏-厌秋 提交于 2019-12-07 05:40:02
问题 I am trying for the past few days to upload a locally saved sounde record to a server (which handels it with a php file and saves it to the server). the problem is that I can't find a way to do that. While recording the sound (AVAudioRecorder) it saves at a "NSTemporaryDirectory()": NSURL *temporaryRecFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"VoiceFile"]]]; Now, everywhere I checked the answer was to use ASIHTTPRequest.