nsurlconnection

Use Apple recommended NSURL delegate methods

和自甴很熟 提交于 2020-01-07 02:44:19
问题 The answer to my original question uses the following code. NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:self.urlNameInput.text] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; [NSURLConnection sendAsynchronousRequest:theRequest queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *connection, NSData *data, NSError *error){...}]; My original code did not work, but was as follows. My code used a set of delegate methods (

Geting NSURLConnection error while calling HTTPS Soap service

百般思念 提交于 2020-01-06 19:58:33
问题 I am trying to get data from Soap request but getting my app crashed with this error: 2016-02-08 11:12:11.524 Example[567:128898] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843) Response: nil fatal error: unexpectedly found nil while unwrapping an Optional value I have enabled Security settings in plist and calling other services successfully. Note: The service is on HTTPS, am i getting this error because of this? is this required any certificate? i am calling

Geting NSURLConnection error while calling HTTPS Soap service

会有一股神秘感。 提交于 2020-01-06 19:58:03
问题 I am trying to get data from Soap request but getting my app crashed with this error: 2016-02-08 11:12:11.524 Example[567:128898] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843) Response: nil fatal error: unexpectedly found nil while unwrapping an Optional value I have enabled Security settings in plist and calling other services successfully. Note: The service is on HTTPS, am i getting this error because of this? is this required any certificate? i am calling

NSURLConnection - Is it possible to wait/block on a request?

不打扰是莪最后的温柔 提交于 2020-01-06 16:39:59
问题 I need to wait for a response from a SOAP webservice, I am calling via a NSURLConnection as I need to manipulate the data being returned and then return it from my class to the calling class.. Here is my code: #import <Foundation/Foundation.h> @interface UsersBLL : NSObject { NSMutableData *webData; NSMutableString *soapResults; NSXMLParser *xmlParser; BOOL *recordResults; NSNumber *EmailCount; } @property(nonatomic, retain) NSMutableData *webData; @property(nonatomic, retain) NSMutableString

NSURLConnection - Is it possible to wait/block on a request?

泄露秘密 提交于 2020-01-06 16:39:06
问题 I need to wait for a response from a SOAP webservice, I am calling via a NSURLConnection as I need to manipulate the data being returned and then return it from my class to the calling class.. Here is my code: #import <Foundation/Foundation.h> @interface UsersBLL : NSObject { NSMutableData *webData; NSMutableString *soapResults; NSXMLParser *xmlParser; BOOL *recordResults; NSNumber *EmailCount; } @property(nonatomic, retain) NSMutableData *webData; @property(nonatomic, retain) NSMutableString

NSURLConnectionDelegate methods not called when using NSThread

五迷三道 提交于 2020-01-05 15:23:51
问题 I'm trying to run a download in a background thread as to not block the main UI thread on iOS, what I did was create a new thread using [NSThread detachNewThreadSelector:@selector(startDownload) toTarget:downloadObject withObject:nil]; Then the following code runs on a background thread: NSURL* urlForCalendar = [NSURL URLWithString:@"http://www.apple.com/"]; urlRequest = [NSURLRequest requestWithURL:urlForCalendar]; urlConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate

Clear NSURLSession Cache

这一生的挚爱 提交于 2020-01-04 09:39:10
问题 I'm using NSURLSession to perform an HTTP Post NSMutableURLRequest , using the dataTaskWithRequest:completionHandler: method. When I perform a request for the first time, things take a reasonable amount of time to complete and show some feedback in the completion handler. On the next time that same request is fired, it happens almost instantaneously with very little time in between, which leads me to believe that the system is caching the contents of this data task. As I don't need to view

Clear NSURLSession Cache

限于喜欢 提交于 2020-01-04 09:39:04
问题 I'm using NSURLSession to perform an HTTP Post NSMutableURLRequest , using the dataTaskWithRequest:completionHandler: method. When I perform a request for the first time, things take a reasonable amount of time to complete and show some feedback in the completion handler. On the next time that same request is fired, it happens almost instantaneously with very little time in between, which leads me to believe that the system is caching the contents of this data task. As I don't need to view

How to change NSURLConnection's priority?

喜欢而已 提交于 2020-01-04 08:16:14
问题 I'm working on a music app, which use ASIHTTPRequest to access to server's api, and use NSURLConnection to download music files. One music file is 10M or so. When downloading music file, access to server's api will be much more slow than not downloading music file. So I want to change download connection's priority lower. But there is no API to change priority of NSURLConnection or NSURLRequest . How to archive this? 回答1: I think only NSOperationQueues can be priorized. Here is a link to an

iOS: Get file's metadata

試著忘記壹切 提交于 2020-01-03 11:51:39
问题 I have an mp3 file on a server. I want to get this file's information like what's the size of this file, what's the artists name, what's the album name, when was the file created, when was it modified, etc. I want all this information. Is it possible to get this information without actually downloading the whole file? Using NSURLConnection or otherwise? EDIT: The following code doesn't give me the required information, i.e. file created by, artist name, etc NSError *rerror = nil;