nsurlconnection

MonoTouch: How to download pdf incrementally as indicated in the Apple slides “Building Newsstand Apps”, Session 504?

杀马特。学长 韩版系。学妹 提交于 2020-02-04 07:19:51
问题 This is a followup to : MonoTouch: How to save a huge PDF downloaded from an URL incrementally? I'm trying to follow the guidelines indicated by the Apple slides of the Newsstand presentation ("Building Newsstand Apps", Session 504): http://adcdownload.apple.com//wwdc_2011/adc_on_itunes__wwdc11_sessions__pdf/504_building_newsstand_apps.pdf Apple recommends the use of the NSURLConnection Delegate and NKAssetDownload for downloading and resuming the newsstand content, but I don't understand

iOS - communication between API object and controllers

点点圈 提交于 2020-02-01 08:18:07
问题 I am curious about 2 things: 1 whats the efficient and easy-to-scale way to design communication between object that communicates with API and viewcontrollers 2 how to design the communicating object itself (how to design methods to be scalable,..) (My approach mention below is messy, I know, but the deadlines were crazy and until now I didn't have time to think about it really.) Let me introduce the task I was dealing with: I had to write 2-3 apps depending on communication with API. There

iOS App Transport Security issue

时光总嘲笑我的痴心妄想 提交于 2020-01-25 20:32:51
问题 TL; DR: I have an iOS app connecting to a webservice that does not meet the minimum requirements for the new ATS feature. I have modified my Info.plist to allow an exception so my app can still connect to the webservice. (NSURLSession/NSURLConnection HTTP load failed on iOS 9 ) This works correctly in development, however, the update I just pushed to the store still fails to hit the webservice. I don't know where the disconnect is happening or how to fix this. === First off, this is all

iOS App Transport Security issue

倾然丶 夕夏残阳落幕 提交于 2020-01-25 20:32:12
问题 TL; DR: I have an iOS app connecting to a webservice that does not meet the minimum requirements for the new ATS feature. I have modified my Info.plist to allow an exception so my app can still connect to the webservice. (NSURLSession/NSURLConnection HTTP load failed on iOS 9 ) This works correctly in development, however, the update I just pushed to the store still fails to hit the webservice. I don't know where the disconnect is happening or how to fix this. === First off, this is all

iOS App Transport Security issue

人走茶凉 提交于 2020-01-25 20:32:07
问题 TL; DR: I have an iOS app connecting to a webservice that does not meet the minimum requirements for the new ATS feature. I have modified my Info.plist to allow an exception so my app can still connect to the webservice. (NSURLSession/NSURLConnection HTTP load failed on iOS 9 ) This works correctly in development, however, the update I just pushed to the store still fails to hit the webservice. I don't know where the disconnect is happening or how to fix this. === First off, this is all

NSURLConnection Unable to http post large file

百般思念 提交于 2020-01-25 11:06:26
问题 We are trying to add in functionality into our app to allow it to POST a large file approx 50kb to our web service the file itself is a HTML template, however with the code below what we are finding is that the data seems to get cut off when the web service saves it. The web service is currently designed to check the $_POST['html'] variable and write it to a file. Is there a better way to do this and does anyone have any idea why the upload is not complete? Thanks Aaron NSString *myText;

check which request is which from NSURLConnection delegate

僤鯓⒐⒋嵵緔 提交于 2020-01-25 08:51:09
问题 What is the best way to check which request is which inside the delegate method: - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { } Right now I have a NSURLConnection that I set to the NSURLConnection before making a request and inside didReceiveResponse I do: if (self.tempConnection == connection) however there is a possiblity this won't work for race conditions. Is there a better way to do this? 回答1: There is a better way in OS5. Forget about

Creating a single JSON Parser/Network object

大兔子大兔子 提交于 2020-01-25 01:02:40
问题 What I'm looking for is a point in the right direction of helping me create a better concept of what I need to do within my application design. What I'm trying to do is have a class that will make network requests, IE: getUser, getTimeline, getLocation. Once the data has been recieived via -(void)connectionDidFinishLoading: have JSON (for my application I'm using TouchJSON) to parse the the data and with that data return an array or object of it. All the above I can do, however I find I need

Send e-mail with attachments using gmail rest api -objective-c

南笙酒味 提交于 2020-01-25 00:43:52
问题 I am trying to send an e-mail with attachment using gmail api. This is my url request: NSString *urlString = [NSString stringWithFormat:@"%@?access_token=%@&uploadType=multipart", @"apiURL", @"access_token"]]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"message" ofType:@"txt"]; NSString *myText = [NSString stringWithContentsOfFile:filePath];

return string inside block of NSURLConnection - Incompatible block pointer types sending

柔情痞子 提交于 2020-01-24 13:17:51
问题 I am trying to isolate logic responsible for authentication and retriving the TOKEN inside the function. I have the problem with returning the string with token from BLOCK of NSURLConnetcion. It causues semantic error : Incompatible block pointer types sending 'NSString *(^)(NSURLResponse *__strong, NSData *__strong, NSError *__strong)' to parameter of type 'void (^)(NSURLResponse *__strong, NSData *__strong, NSError *__strong)' I am completly newbie to Objective-C, so please be forgiving.