TTURLRequest works in Simulator, not on Device

24 views
Skip to first unread message

Justin Searls

unread,
Mar 26, 2009, 11:52:54 AM3/26/09
to Three20
I'm loving the cache options TTURLRequest gives you straight away, but
I'm having trouble porting my use of the class from the Simulator to
an actual device. Take this code, for instance:

TTURLRequest* request = [TTURLRequest requestWithURL:aUrl
delegate:self];
request.response = [[[TTURLDataResponse alloc] init] autorelease];
if(!isCaching)
request.cachePolicy = TTURLRequestCachePolicyNetwork;
request.cacheExpirationAge = expirySeconds;

if([request send]) {
NSLog(@"Loaded URL from cache");
} else {
NSLog(@"Loading URL from web");
}

I have the proper delegate methods implemented on self and it works
fine in Simulator. However, when I bring it to the device, I get this
error:

2009-03-26 11:43:45.124 MobileGAF[879:107] *** -[TTURLRequestQueue
performSelector:withObject:withObject:withObject:]: unrecognized
selector sent to instance 0x1269b0
2009-03-26 11:43:45.142 MobileGAF[879:107] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '*** -
[TTURLRequestQueue performSelector:withObject:withObject:withObject:]:
unrecognized selector sent to instance 0x1269b0'
2009-03-26 11:43:45.154 MobileGAF[879:107] Stack: (
807932053,
805382800,
807935969,
807649295,
807545680,
186287,
810746681,
810746553,
833677525,
833680179,
833678801,
833511373,
833465849,
833465937,
807530583,
807528671,
838923228,
814630460,
814664984,
8381,
8244
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.

Note that this is exactly the same error I get in the Simulator when I
leave out the '-ObjC' linker flag. I get a bunch of similar errors
whenever I attempt to use the TTCatalog on my device.

Ideas?

Adam Jack

unread,
Mar 26, 2009, 12:08:15 PM3/26/09
to thr...@googlegroups.com
I just joined this list (so really ought be listening not speaking, never seem to learn that ;-) but reading t his (right before I attempt to do the same thing, thanks) I have to ask...

.... is it possibly your device build is missing the -ObjC flag?

I've had problems where I edited the project settings (using Project/Edit Project Settings and setting the config I wanted) and yet xcode failed to set them properly. I found that Project/Edit Active Target (with the config I wanted set as current config) did a better job.

Please ignore the noise if you are certain -ObjC is being used on the device build.

Please post when you get a solution since I hope to be a few hours from trying this...

regards

Adam

Justin Searls

unread,
Mar 26, 2009, 12:32:25 PM3/26/09
to Three20
Hi Adam,

I welcome any and all input with respect to the questions I ask,
especially because I'm still very new to working in Xcode. Even noise
is useful in the absence of any signal.

You're quite right, it looks like the Project Settings and the Target
Configuration are not the same thing. The latter did have -ObjC set,
but the former did not. However, it seems that adding the flag
everywhere I could while Device was my active config didn't fix the
issue, as I'm still getting the same error.

I wonder if there's a way I could rummage around the file structure in
Organizer to dig deeper. I have a feeling that I'm just missing
something that's wholly elemental, like what you proposed, though.

Anyway, if you have any luck using a TTURLRequest in your work later
today, feel free to reply back here with any insight or ideas on what
I'm doing wrong :)

Thanks!

Adam Jack

unread,
Mar 26, 2009, 12:55:45 PM3/26/09
to thr...@googlegroups.com
Justin

XCode noobies unite. I am there. :-)

Right after I sent you that mail (and started coding myself) I had exactly this problem again. I set the Header Search Path yet could not find the Three20/Three20.h file I knew to be there. Turns out the path was set for release config but not for debug config. Doh, still cost me 5 minutes! I have started using show "Settings Defined At This Level" to prove to myself things are set. This is (IMHO) a bug in XCode, but maybe it is just far smarter than me.

So, to see if it helped you, I just added this to my code and ran it on the device. Worked 100% (for icons in a UITableView) with like one line of code. Thank you Three20! 

My guess Justin is you have the answer, you gave it in your question ... that -ObjC is *still* not being set on your build. I think you can increase build verbosity (to see command lines and build flags) but I forget how.

Good luck.

regards,

Adam

Justin Searls

unread,
Mar 26, 2009, 5:08:32 PM3/26/09
to Three20
Hi again Adam,

I can now confirm that this issue is 100% caused by building targets
for Device OS 3.0, by downgrading the target OS to 2.2.1, TTURLRequest
works fine.

Guess it'll be an interesting side project to figure out why that is..

-Justin

TC

unread,
Apr 10, 2009, 1:46:00 PM4/10/09
to Three20
Did anyone make progress on this? I just ran into this error after
upgrading my phone.

Looks like Joe's NSObjectAdditions aren't loading, and so the NSObject
performSelector: withObject: withObject: withObject: can't be found.
Reply all
Reply to author
Forward
0 new messages