asihttprequest

Use a self-signed ssl certificate in an iphone app

痞子三分冷 提交于 2019-11-27 09:06:27
问题 I apologize in advance for the long-winded question. I'm having trouble with a self-signed SSL cert and I want to document everything I've tried so far. I'm working on an app that communicates with a REST service. The test server uses a self-signed ssl certificate that I can install on my computer without issue. It's a .p12 file that requires a password to install. Without this certificate installed, all requests to the server return a 403. The .p12 installs three items in the Keychain, a

Best architecture for an iOS application that makes many network requests?

一世执手 提交于 2019-11-27 08:56:09
问题 I'm in the process of rethinking my approach to the request architecture of a large app I'm developing. I'm currently using ASIHTTPRequest to actually make requests, but since I need many different types of requests as a result of many different actions taken in different view controllers, I'm trying to work out the best system of organizing these requests. I'm currently building singleton "requesters" that are retained by the app delegate and sit around listening for NSNotifications that

ASIHTTPRequest / ASIFormDataRequest - referencing request object within blocks under ARC

浪子不回头ぞ 提交于 2019-11-27 05:40:00
问题 Very similar to this question, I am trying to convert a project that uses ASIHTTPRequest & ASIFormDataRequest to ARC. In my view controller classes, I often refer to and use properties of the request object in the completion blocks (looking at the response code, response data etc): __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:SOME_URL]]; [request setCompletionBlock:^{ if([request responseStatusCode] == 200) ....etc When converting to ARC I get

ASIHTTPRequest: https with SSL

梦想与她 提交于 2019-11-27 05:25:14
问题 How to implement a https connection with SSL and ASIHTTPRequest ? Are there some special steps to do? Can it be that this has nothing to do with ASIHTTPRequest ? It has to do only with the server-side I think. Can someone post a link or describe the process of how a https connection can be established? This is what I found out so far: I read somewhere that you need a "real" SSL certificate and not a self signed one. There are also not all provider of SSL certificates supported I think (read

What major ASIHTTPRequest features is AFNetworking missing?

纵饮孤独 提交于 2019-11-27 04:56:55
问题 With work having recently stopped on ASIHTTPRequest, it seems like attention is shifting to AFNetworking. However, I've not yet found a good comparison of the features of the two libraries, so I don't know what I might lose if/when I switch over. Major differences I've spotted so far are: AFNetworking has a much smaller code size (which is good) AFNetworking is being rapidly improved (so it may not yet be mature, may not have a stable API yet?) Both seem to have caching, though I've seen

Why are my ASIHTTPRequest files showing ARC errors?

蹲街弑〆低调 提交于 2019-11-27 00:58:24
问题 I have implemented all of my ASIHTTPRequest files, but unfortunately the following errors occur: Why is this happening? 回答1: ASIHTTPRequest doesn't support ARC, so it is expected you get errors if you use it in an project with ARC enabled. There are various solutions on how to disable ARC just for the asihttprequest files suggested here: https://github.com/pokeb/asi-http-request/issues/210 The easiest one is just to disable ARC for the ASIHTTPRequest source files, see here : How can I disable

UILabel text not being updated

二次信任 提交于 2019-11-27 00:17:27
问题 I am unable to change the UILabel text. The code for the the UILabel inside viewDidLoad is : startLabel=[[UILabel alloc] initWithFrame:CGRectMake(75, 395, 200, 30)]; startLabel.text=@"Recording Sound ..."; startLabel.backgroundColor=[UIColor clearColor]; startLabel.textColor=[UIColor whiteColor]; startLabel.font=[UIFont boldSystemFontOfSize:17]; [self.view addSubview:startLabel]; Later, if I want to change the label of the text with the following code, its not changing on the app : startLabel

Objective-C: Instance Variable in Category

纵饮孤独 提交于 2019-11-26 16:17:13
问题 I am just asking whether it was possible to add an instance variable via a category. My special problem is, that I need to add an NSIndexPath property to an ASIHTTPRequest object but I don't wanna subclass the ASIHTTPRequest as a matter of principle. Do I have any kind of alternative? Thanks for your answers, Christian 回答1: A category can not declare additional instance variables but since OS X 10.6 and iOS 3.1 you can work around this with associative references. You can use associative

returning UIImage from block

岁酱吖の 提交于 2019-11-26 14:56:45
问题 I have the following code: - (UIImage *) getPublisherLogo { //check the cache if the logo already exists NSString * imageUrl = [NSString stringWithFormat:@"%@/%@&image_type=icon", self.baseUrl, self.imageUrl_]; ASIHTTPRequest * imageRequest = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:imageUrl]]; [imageRequest setTimeOutSeconds:30.0]; [imageRequest setDownloadCache:[ASIDownloadCache sharedCache]]; [imageRequest setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];

Does AFNetworking have backgrounding support?

家住魔仙堡 提交于 2019-11-26 08:04:55
问题 I\'m in the process of investigating AFNetworking as a replacement for ASIHTTPRequest , and notice a complete lack of information on whether it supports background downloads/uploads. With an ASIHTTPReqeust object, all you have to do is call [request setShouldContinueWhenAppEntersBackground:YES] and the request will continue in the background. Is there any support for this in AFNetworking ? 回答1: EDIT : As of AFNetworking 1.0RC1, this is an explicit feature. AFURLConnectionOperation now has the