nsurlconnection

how secure is NSURLConnection over https

北战南征 提交于 2019-12-13 17:13:05
问题 I've been reading through a number of questions on this site regarding NSURLConnection and https, but most relate to "untrusted" certificates and how to allow them nonetheless. My question is a little more basic. I am building an app for a client who handle online donations, and I would like to load their donation script using an NSLURLRequest and POST the values of credit card details (entered in the app). Does NSURLConnection (when connecting to a https url) ensure the encryption of those

how can I use NSURLConnection Asynchronously?

纵然是瞬间 提交于 2019-12-13 09:45:51
问题 I am using this code to load data to my App, can you tell me how can I make this asynchronously? NSMutableURLRequest *request2 = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:requestString] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:10.0]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request2 delegate:self]; if (connection) { NSLog(@"NSURLConnection connection==true"); NSURLResponse *response; NSError *err; NSData *responseData =

How to load content fast with images loading in background?

大兔子大兔子 提交于 2019-12-13 08:22:49
问题 I want to make image load in background and let content load first. I tried below code but didnt work. What is wrong? Help me. Thank you in advance. - (void)viewDidLoad { [super viewDidLoad]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"site.com/json.php"]]; [[NSURLConnection alloc] initWithRequest:request delegate:self]; } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSError *myError = nil; NSDictionary *res = [NSJSONSerialization

Start NSURLConnection requests serially

痴心易碎 提交于 2019-12-13 07:14:19
问题 I'm looping through an array which contains few strings and making a request to a web server for each strings in the array. I would like each request to be processed completely before the subsequent request is sent to the server. Because each request sends me a response which I will send with next request and so on. The problem I am having is that my NSURLConnection is set up using the standard asynchronous call. This results in requests not blocking any subsequent requests. But I need to

NSURLConnection and bound pair of streams (CFStreamCreateBoundPair or CFStreamCreateBoundPairCompat) not working on iPhone 3G

蓝咒 提交于 2019-12-13 05:41:26
问题 I'm using SimpleURLConnections example to implement multipart/form-data POST request using bound pair of streams. It works great in Simulator and on iPhone 3GS/iPhone 4. When I try it on iPhone 3G (running 3.1.3) no data gets sent to the server. NSURLConnection just keeps hanging until it times out. After some testing I figured that the problem only occurs when I write to the producer stream more than once per connection. Whenever I need to write more than once (that is when I have to respond

iOS: How to load local files (not in the bundle) in a WKWebView?

喜欢而已 提交于 2019-12-13 05:29:06
问题 I would like to use a WKWebView (not a UIWebView) and load some html files in it. I precise that I put the ArbitraryLoads to YES in info.plist. (For info, it works on simulator but not on device). <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> Here is my code: WKWebViewConfiguration *theConfiguration = [[WKWebViewConfiguration alloc] init]; [theConfiguration setMediaPlaybackAllowsAirPlay:YES]; [theConfiguration setAllowsInlineMediaPlayback:YES];

Can't Receive JSON Request Via HTTPS Due To Untrusted Certificate

旧城冷巷雨未停 提交于 2019-12-13 05:06:18
问题 I have been googling this problem for hours now, and I can't seem to find a solution. The last tutorial I followed was this tutorial explaining how I could send a JSON request over an untrusted SSL connection (in this case, a self-signed certificate). In short, the code I have tried so far is this one: This method checks if the token is valid with my web API: -(BOOL)linked { if([self token] == nil) { return NO; }else { NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?token=%@

Can't get the total length of downloading file

落爺英雄遲暮 提交于 2019-12-13 04:57:32
问题 NSMutableURLRequest *objRequest =[[NSMutableURLRequest alloc]initWithURL:url1]; [objRequest setHTTPMethod:@"POST"]; [objRequest setHTTPBody:[NSData dataWithBytes:(__bridge const void *)(dict) length:[dict count]]]; NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:[NSURLRequest requestWithURL:url1] delegate:self]; [connection start]; -(void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ length = [response expectedContentLength];

NSURLConnection Delegate Returns Null

心已入冬 提交于 2019-12-13 04:56:14
问题 I have followed a handful of examples on NSURLConnection, see latest below, but yet I keep getting null on the returned FinishLoading. I checked didReceiveResponse and its getting the data. What am I not doing right here? EDITED: Now works as expected. #pragma mark NSURLConnection Delegate Methods - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { _dataDictionary = [NSMutableDictionary new]; _theReceivedData = [NSMutableData new]; [_theReceivedData

NSOperationQueue with synchronous NSURLConnection

女生的网名这么多〃 提交于 2019-12-13 04:35:30
问题 Building on an earlier question: I have an NSOperationQueue that looks like this: NSBlockOperation *block1 = [NSBlockOperation blockOperationWithBlock:^{ [someObject someSelector]; }]; NSBlockOperation *block2= [NSBlockOperation blockOperationWithBlock:^{ [someObject anotherSelector]; }]; [block2 addDependency:block1]; [queue addOperation:block1]; [queue addOperation:block2]; Now, inside someSelector I have: returnData = [requesterObj getDataWithURL:(NSString*)url]; where getDataWithURL