Take the 2-minute tour ×

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:


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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
TTURLRequest is from facebook's three20 library. Here's the complete source: gist.github.com/638669 –  smtlaissezfaire Oct 21 '10 at 15:22
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 Oct 21 '10 at 23:23
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 Oct 25 '10 at 20:40
0. Delete the app on the phone if already present 1. Select Ad Hoc Release, Device 2. Navigate into each of three20's dependencies (under Groups & Files => Clicking on project). Once inside the project, hit the active target, set base sdk to iOS device 4.1, and active architectures to standard (armv6, armv7) –  smtlaissezfaire Oct 25 '10 at 20:41
3. Clean everything: Build -> Clean Targets Also Clean Dependencies Also Remove Precompiled headers screencast.com/t/GP3TuqE5 4. 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 Oct 25 '10 at 20:42
add comment

Your Answer


