views:

16

answers:

1

I'm seeing the following crash on two different devices (an iphone 3g and an ipod touch) when in adhoc mode, although it seems to be OK when building in debug mode for those devices. It also seems to be OK on iPhone 4's.

Here's the stack trace that I'm getting in ad hoc mode:

https://gist.github.com/af5ea32f2dacc795387e

From what I can tell, this stack trace is producing a recursive call to requestWithURL:delegate: - although it makes no such call in code:

///////////////////////////////////////////////////////////////////////////////////////////////////
+ (TTURLRequest*)requestWithURL:(NSString*)URL delegate:(id /*<TTURLRequestDelegate>*/)delegate {
  return [[[TTURLRequest alloc] initWithURL:URL delegate:delegate] autorelease];
}

So what's going on here? How can I debug this further?

A: 

From your stack trace (line 8) it looks like something is calling an undefined function

8   CoreFoundation                  0x000a5b28 -[NSObject(NSObject)    doesNotRecognizeSelector:] + 8
9   CoreFoundation                  0x0004ae00 ___forwarding___ + 500
10  CoreFoundation                  0x0004abb8 _CF_forwarding_prep_0 + 40
11  App                         0x0005684a +[TTURLRequest requestWithURL:delegate:] + 42
12  App                         0x00056840 +[TTURLRequest requestWithURL:delegate:] + 32

First add some print statements in to see which function call is the offender, use:

[object doesRespondToSelector:@selector(someFunction:withArg:)]

If it is not your code which is calling an undefined function make sure the arguments you are passing in are valid, print out the value of URL, and delegate to ensure they are are indeed of the expected type and value. Most importantly make sure that delegate does respond to whatever messages TTURLRequest will pass to it.

Also, is TTURLRequest your class, can you give the full definition, does it extend another class, does it define 'initWithURL'? Can we see the source? Those are important questions for anyone trying to debug your code.

Akusete
TTURLRequest is from facebook's three20 library. Here's the complete source: http://gist.github.com/638669
smtlaissezfaire
Just a thought, are you sure you are linking the TTURLRequest source properly, and don't just have the header included? From the information given I can't think of anything else which would give you a doesNotRecognizeSelector: error on initialization.
Akusete
Akusete - turns out you were right. Basically, a bunch of the three20 subprojects were compiling for the right architecture when compiling for ad hoc. Here's what I did to fix it:
smtlaissezfaire
smtlaissezfaire
3. Clean everything: Build -> Clean Targets Also Clean Dependencies Also Remove Precompiled headers http://screencast.com/t/GP3TuqE54. Rebuild for Device, Ad Hoc release. It should start up, but will crash the first time. Now, relaunch the app from the device, and all should be good.
smtlaissezfaire