Tag: asihttprequest

新手卡住:ASIHTTPRequest – 没有已知的类方法select器“requestWithURL”

我引用ASIHTTPRequest并得到它在iOS5编译。 但是,当我尝试使用它: ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; 我得到错误 no known class method for selector 'requestWithURL'. 还setCacheStoragePolicy和startAsynchronous抛出错误。 实际上我在ASIHTTPRequest.m文件ASIHTTPRequest.m不到这个方法。 我错过了什么? 这是从github下载的最新代码。 谢谢,约翰。

如何find并解决崩溃的原因

我向应用程序商店提交了一个应用程序,因为: “我们发现你的应用程序在运行iOS 6.1.2的iPhone 5上崩溃,这不符合App Store评论指南。 我们的应用程序崩溃了: 当用户点击login到应用程序时,会产生崩溃。 这发生在您的应用程序被使用时: 在Wi-Fi上 在蜂窝networking上 如果使用的内存太多,您的应用程序可能会遇到此问题。 要了解有关iOS内存使用情况以及如何跟踪内存使用情况和泄漏情况的更多信息,请参阅“内存使用性能指南”。 我无法在我身边再次触发崩溃。 我使用分配工具来分析我的应用程序,并看到我的活动字节从未超过12MB。 泄漏仪器,我发现我有一些泄漏(都在第三方来源),但他们是非常小的,不应该有应用程序崩溃..我不知道该怎么做.. 由于使用太多的内存,应用程序真的崩溃了吗? 会有另一个原因吗? 我应该如何解决这个问题并解决问题? 编辑 – 附上崩溃日志 看看这个 &看起来好像使用ASIHTTPRequest框架导致崩溃一些如何,但只能在临时或分布构build,这使得debugging更令人头疼。 这是真的吗? 我应该改用AFNetworking吗?

ASIHTTPRequestTester:asynchronous不起作用

我正在尝试使用ASIHTTPRequest为iOS创build应用程序,但是我正在使用它来解决一些问题。 为了演示我的问题,我已经上传了一个testing项目,你可以从这里下载: http : //uploads.demaweb.dk/ASIHTTPRequestTester.zip 。 我创build了一个使用ASIHTTPRequestDelegate协议的WebService类: #import "WebService.h" #import "ASIHTTPRequest.h" @implementation WebService – (void)requestFinished:(ASIHTTPRequest *)request { NSLog(@"requestFinished"); } – (void)requestFailed:(ASIHTTPRequest *)request { NSLog(@"requestFailed"); } – (void) testSynchronous { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; NSLog(@"starting Synchronous"); [request startSynchronous]; NSError *error = [request error]; if (!error) { NSLog(@"got response"); } } […]

铛:错误:没有这样的文件或目录:ASIAuthenticationDialog.m

我有这个错误: clang: error: no such file or directory: '/Users/usuario/Desktop/echonest-echoprint-ios-sample-b937c04/Classes/ASIHTTP/clang: error: no such file or directory:' 我想运行“ echoprint-ios-sample ”项目,并导入ASIHTTP文件 我不知道是什么问题:( 有人可以帮助我吗? 谢谢!

如何从表中删除单元格

我使用asihttprequest来下载文件,但是当下载失败时,与表中文件相关联的单元格不会从tableview中删除。 当我刷卡删除,我有这个错误: *终止应用程序由于未捕获的exception'NSRangeException',原因:'* – [NSMutableArray objectAtIndex:]:索引0超出空数组的边界' 我怎样才能删除单元格? MANAGER.h NSMutableArray *contentArray; MANAGER.m – (id)initWithStyle:(UITableViewStyle)style { if (self == [super initWithStyle:style]) { self.navigationController.navigationBar.tintColor = [UIColor blackColor]; self.navigationItem.rightBarButtonItem = self.editButtonItem; contentArray = [[NSMutableArray alloc] init]; progArray = [[NSMutableArray alloc] init]; self.view.backgroundColor = [UIColor clearColor]; //saveTo = [[NSUserDefaults standardUserDefaults] stringForKey:@"save_to"]; AppDelegate_iPhone* delegate = (AppDelegate_iPhone *)[[UIApplication sharedApplication] delegate]; if([delegate saveTo] […]

ASIHttpRequest忽略setValidatesSecureCertificate参数

在某些情况下,ASIHTTPRequest可以忽略“setValidatesSecureCertificate”参数吗? 如果我这样做: NSURL *url = [NSURL URLWithString:@"https://someselfsignedurl"]; ASIHTTPRequest *r = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease]; [r setValidatesSecureCertificate:YES]; [r startSynchronous]; // Should not work: NSLog(@"Result: %@", [r error] ? [[r error] description] : [r responseString]); 我有预期的行为,即NSError告诉证书是自签名和空响应。 然而,在我的源代码的其他部分,完全相同的代码似乎忽略validation,实际上得到的结果,而不是返回一个SSL错误。 在第三方库或实例中完成的任何“全局”configuration是否可以与SSLvalidation进行交互?

如何调用本地图像文件并显示到imageviewcontroller

我创build了一个应用程序,在应用程序不被删除的同时创build本地存储支付文件。 这我已经做了:我下载文件并存储到本地(应用程序文档文件夹)。 现在我遇到了这个问题:当图像被下载后,我将进入本地,该图像不会显示。 在NSLog下面的URL生成,我不能显示图像。 /Users/username/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/F233ED88-1546-4FB0-BE93-0E0FB8C8C3D6/Documents/NationalMedalofArts-150×150.jpg 编辑: NSURL *imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@", @"/Users/username/Library/Application Support/iPhone Simulator/5.0/Applications/F233ED88-1546-4FB0-BE93-0E0FB8C8C3D6/Documents/NationalMedalofArts-150×150.jpg"]]; NSData *imageData = [NSData dataWithContentsOfURL:imageURL]; NSLog(@"%@",imageData); UIImage *image = [UIImage imageWithData:imageData]; self.imgView.image = image; 当NSLog的NSData然后它是NULL显示

ASIHTTPRequest错误消息 – 初学者

我正在使用ASIHttpRequest。 我需要知道这个错误信息是什么意思? 我怎么解决呢 请求错误<ASIHTTPRequest:0xbedc00> – 错误域= ASIHTTPRequestErrorDomain代码= 1“发生连接失败”UserInfo = 0x270230 {NSUnderlyingError = 0x250cf0“操作无法完成(kCFErrorDomainCFNetwork错误2)”,NSLocalizedDescription =连接失败发生} 还有更多的错误信息; 以上是Error Domain=ASIHTTPRequestErrorDomain Code=1其他是Code=2 , Code=3 … Code=10 。 我需要这些也是什么? 编辑:错误显示在if condition SBJsonParser *p = [SBJsonParser new]; NSDictionary *content = [pobjectWithString:[request responseString]]; if(!content){ NSLog(@" %@", p.errorTrace); return; }

定时器vs ASIHTTPRequest – find最佳解决scheme

代码如下所示,一旦你点击一个button,每4秒激活一次定时器和定时器的调用方法。 但是,有时4秒是不够的服务器返回数据。 但是,如果服务器在1秒内返回数据并且不利于用户等待更长时间,则增加计时器值也不是好的解决scheme。 在这种情况下,我不知道什么是最佳/最佳解决scheme。 -(IBAction)play:(id)sender{ timer=[NSTimer scheculedWith TimerInterval(4.0) target:(self)selector:@selector(httpRequest) userinfo:nil repeats:YES] } -(void)httpRequest{ _weak ASIHTTPRequest *request1 = [ASIHTTPRequest requestWithURL:url1]; [request1 setCompletionBlock:^{ NSString *responseString1 = [request1 responseString]; //dispatch_async(backgroundProcess1,^(void){ [self plotOverlay1:responseString1]; //}); }]; [request1 setFailedBlock:^{ NSError *error=[request1 error]; NSLog(@"Error: %@", error.localizedDescription); }]; [request1 startAsynchronous]; }

在closuresUIWebView后维护会话

我有一个应用程序有一个login页面驻留在应用程序服务器上。 所以我打开一个UIWebView来处理login。 之后,我想切换到UIView,并使用ASIHttp库进行API调用(其他人也可以接受)。 问题是; 在我login服务器保持会话对象进行身份validation的目的,所以当我closuresUIWebView并切换到一个UIView,并进行API调用,失败。 我相信,不知何故,我需要维护API调用中的会话对象(login后设置)。 我怎样才能做到这一点?