nsurlconnection

Add UIProgressView to a NSURLConnection?

巧了我就是萌 提交于 2019-12-08 06:49:46
问题 Is it possible to add a UIProgressView to a NSURLConnection? Is it as simple as getting the length of the data and then setting it to an int then sending that int to my other class to my UIProgressView? Can someone show me how to do this? Are there any examples or links that will point me in the right direction? Thanks!!! 回答1: In your didReceiveResponse function you could get the total filesize like so - _totalFileSize = response.expectedContentLength; . In your didReceiveData function you

How to cancel a video upload in progress using the Facebook iOS SDK?

旧城冷巷雨未停 提交于 2019-12-08 05:48:52
问题 I'm using the Facebook iOS SDK to post videos from my app to the user's facebook. I'm trying to allow the user to cancel the upload after the upload has started. These are the methods that starts the upload: - (void)startUpload { NSArray* permissions = [[NSArray alloc] initWithObjects: @"publish_stream", nil]; [facebook authorize:permissions]; [permissions release]; } - (void)fbDidLogin { NSString *filePath = [videoNSURL path]; NSData *videoData = [NSData dataWithContentsOfFile:filePath];

Moving from NSURLConnection to NSURLSession for SOAP POST in Swift

橙三吉。 提交于 2019-12-08 05:48:25
问题 I am trying to move over from NSURLConnection over to NSURLSession for a SOAP post, but seem to have issues with the NSURLSessionDataDelegate. Here is the old code in NSURLConnection that works fine: let soapMessage = "<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns1='http://tempuri.org/'><SOAP-ENV:Body><ns1:get_Countries/></SOAP-ENV:Body></SOAP-ENV:Envelope>" print("Soap Packet is \(soapMessage)") let urlString =

Subsequent NSURLConnections not firing delegate methods

不打扰是莪最后的温柔 提交于 2019-12-08 05:09:49
问题 I've looked all over for answers to this question and have seen a lot of similar issues but the solutions did not seem to pertain to my situation. I'm very new to iOS development so any help would be appreciated. The current app is looking to display events happening in a city based on an XML feed being generated by their website. I'm storing the events in a plist and checking for new events explicitly on app load. The current process is as follows: Application launches and makes a

Loading images for UITableViewCell from URL (need to load them asynchronously)

喜你入骨 提交于 2019-12-08 02:56:07
问题 I have a custom class that parses through an XML and gets URL strings for images (which I store in an array). Then I want to retrieve those strings to load images and display each in a UITableViewCell. Here is my code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; UILabel *labelText =

Strange problem with appendData in didReceiveData method of NSURLConnection

跟風遠走 提交于 2019-12-08 01:18:11
问题 I got this weird problem in implanting simple NSURLConnection... The method didReceiveData get call and I'm happily trying to append the receive data but... nada! There's some data for sure (as the length indicate but appendData do NOT append the data! I start to bang my head on this one and I need some help before it's to late :-) Here some code to look at : My header... @interface ActionViewController : UITableViewController { Site *site; NSURLConnection *siteConnection; NSMutableData

NSURLConnection didSendBodyData progress

谁说我不能喝 提交于 2019-12-07 17:58:29
问题 I'm using a POST request to upload some data to a server, and I'm trying to update the UIProgressView's progress based on the totalBytesWritten property of the didSendBodyData method of NSURLConnection . Using the below code, I don't get a proper updating of the progress view, it's always 0.000 until it finishes. I'm not sure what to multiply or divide by to get a better progress of the upload. I'd appreciate any help offered! Code: - (void)connection:(NSURLConnection *)connection

Why NSURLConnection delegate methods don't get called, when using the global dispatch queue?

老子叫甜甜 提交于 2019-12-07 17:22:11
问题 When I do the following: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, NULL), ^{ create NSURLRequest; create NSURLConnectionDelegate; create NSURLConnection; start NSURLConnection; }); The delegate's methods never get called. But when I do dispatch_async(dispatch_get_main_queue(), ^{ create NSURLRequest; create NSURLConnectionDelegate; create NSURLConnection; start NSURLConnection; }); They do get called. Why? UPD http://developer.apple.com/library/ios/#qa/qa1712/

Application rejected with the reason of lack of IPv6 support [closed]

喜欢而已 提交于 2019-12-07 16:53:53
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . My last release of application which is 12.8 is rejected by apple saying that i have to add the IPv6 support to the app, I read and reviewed the recommended apple doc named Supporting IPv6 DNS64/NAT64 Networks thoroughly and came to know that already i am using the

Examples for Aspect-Oriented HTTP Authentication in Objective-C

☆樱花仙子☆ 提交于 2019-12-07 15:48:11
问题 I'm looking for some examples, tips, advice, some general sense of direction for implementing (or finding an implementation of) an aspect-oriented HTTP authentication library. For a little groundwork, we've built an iOS library that establishes various forms of authentication for HTTP services, asking for user credientials via web forms or native modal windows, depending on the the mechanism in use. But once the credentials are validated, the library hands them off and basically wipes it's