Ad Hoc iPhone SIGSEGV crash while Debug on device & simulator works

旧巷老猫 提交于 2019-12-06 08:27:36

I found another odd workaround that's solving some of my problems:

Under Target > Build Settings > Apple LLVM compiler 4.0 - Code Generation > Optimization Level I changed Ad Hoc Optimization to None - away from the default Fastest, Smallest [-Os] and this allows me to create a working ipa.

While this does provide a workaround it's less than ideal considering there may be other consequences of me doing no optimization.

But I do think this hints that some of my underlying problems are memory related - can anyone provide any insights into this?

You're doing a synchronous request, so you don't need the failure blocks or completion blocks. That will get rid of all of the __block stuff and make it a bit less weird memory wise.

- (IBAction)grabURL:(id)sender
{
  NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
  ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
  [request startSynchronous];
  NSError *error = [request error];
  if (!error) {
    NSString *response = [request responseString];
  }
}

I got that from the top of http://allseeing-i.com/ASIHTTPRequest/How-to-use

Thanks Randall. startSynchronous may be a bit of a misnomer. Here is the method definition:

- (void)startSynchronous
{
#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING
    ASI_DEBUG_LOG(@"[STATUS] Starting synchronous request %@",self);
#endif
    [self setSynchronous:YES];
    [self setRunLoopMode:ASIHTTPRequestRunLoopMode];
    [self setInProgress:YES];

    if (![self isCancelled] && ![self complete]) {
        [self main];
        while (!complete) {
            [[NSRunLoop currentRunLoop] runMode:[self runLoopMode] beforeDate:[NSDate distantFuture]];
        }
    }

    [self setInProgress:NO];
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!