Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-18-2011, 10:02 AM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default iPhone app crash - how to read logs

Hi,
My app crashes sometimes and I have no idea why and where. Here is my log, but I don't know how to read it:

Code:
-[Order bytes]: unrecognized selector sent to instance 0x335070
 Stack: (
"0   My App                              0x00012de5 My App + 73189",
"1   My App                              0x00013047 My App + 73799",
"2   CoreFoundation                      0x36d15987 __handleUncaughtException + 74",
"3   libobjc.A.dylib                     0x320852d1 _objc_terminate + 128",
"4   libc++abi.dylib                     0x36d783c5 _ZL19safe_handler_callerPFvvE + 76",
"5   libc++abi.dylib                     0x36d78451 _ZdlPv + 0",
"6   libc++abi.dylib                     0x36d7979f __cxa_throw + 122",
"7   libobjc.A.dylib                     0x32085223 objc_exception_throw + 94",
"8   CoreFoundation                      0x36d18acb -[NSObject doesNotRecognizeSelector:] + 174",
"9   CoreFoundation                      0x36d17945 ___forwarding___ + 300",
"10  CoreFoundation                      0x36c72680 _CF_forwarding_prep_0 + 48",
"11  CoreFoundation                      0x36c64bdd CFDataGetBytePtr + 96",
"12  Foundation                          0x337af8db -[NSKeyedUnarchiver initForReadingWithData:] + 322",
"13  Foundation                          0x337d3651 +[NSKeyedUnarchiver unarchiveObjectWithData:] + 52",
"14  My App                              0x0000eef1 My App + 57073",
"15  Foundation                          0x337ada91 -[NSThread main] + 72",
"16  Foundation                          0x338415a1 __NSThread__main__ + 1048",
"17  libsystem_c.dylib                   0x37cb8c1d _pthread_start + 320",
"18  libsystem_c.dylib                   0x37cb8ad8 thread_start + 8"
)
Could someone help me?
bialek is offline   Reply With Quote
Old 10-18-2011, 04:57 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

You called a method named "bytes" on an "Order" object. This "Order" object does not implement a method named "bytes".

You are probably overreleasing something.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 10-19-2011, 02:07 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default

I understand what first row means. Problem is I don't call bytes method on that object.
bialek is offline   Reply With Quote
Old 10-19-2011, 02:23 AM   #4 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Yep which means you are overreleasing your NSData object and an "Order" object took its memory block. So your pointer that pointed to an NSData object is now pointing to an "Order" object.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 10-19-2011, 02:59 AM   #5 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default

Thanks, but what can I do with that, I don't know where to search that.
bialek is offline   Reply With Quote
Old 10-19-2011, 03:06 AM   #6 (permalink)
Registered Member
 
Join Date: Feb 2011
Location: Bucharest, Romania
Age: 22
Posts: 75
nestedloop is on a distinguished road
Default

Debug.
nestedloop is offline   Reply With Quote
Old 10-19-2011, 03:14 AM   #7 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default

Yes I know this is best solution, but that error is on the live app and I can't reproduce that error in my project so I can't debug.
bialek is offline   Reply With Quote
Old 10-19-2011, 03:16 AM   #8 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Well until you can reproduce it, you can't fix it. So keep trying to crash your app, you'll find it eventually.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 10-19-2011, 03:22 AM   #9 (permalink)
Registered Member
 
Join Date: Feb 2011
Location: Bucharest, Romania
Age: 22
Posts: 75
nestedloop is on a distinguished road
Default

@ bialek:

Try using Clang, the static code analyzer that comes with XCode ( you can do that by going to Build Menu -> Build and Analyze).

It will point out any illegal or irregular releases and other logical mistakes of the sort. You might find this particular one between them and solve your problem unknowingly.

Take care though, Clang is quite BETA-ish, sometimes it has false positives.

Cheers, and good luck!
nestedloop is offline   Reply With Quote
Old 10-19-2011, 03:27 AM   #10 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default

That error occurs only after update to a new version, but don't appears in each user who updated the app only in few.
Could you tell me if problem can be here:
I have a custom class which I save in userdefaults using nskeyedarchiver. In that class I have an array with objects of that Order class (but before add it to that array I serialize order object also with nskeyedarchiver). In the new version I deleted one of the properties from that main custom class, but in nsuserdefaults was saved the old version. Maybe now should I delete that custom class from nsuserdefaults?
bialek is offline   Reply With Quote
Old 10-19-2011, 03:29 AM   #11 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default

Quote:
Originally Posted by nestedloop View Post
@ bialek:

Try using Clang, the static code analyzer that comes with XCode ( you can do that by going to Build Menu -> Build and Analyze).

It will point out any illegal or irregular releases and other logical mistakes of the sort. You might find this particular one between them and solve your problem unknowingly.

Take care though, Clang is quite BETA-ish, sometimes it has false positives.

Cheers, and good luck!
I make it all the time and there is no problems.
bialek is offline   Reply With Quote
Old 10-19-2011, 05:13 PM   #12 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Nope, when you retrieve your object from NSData, it allocates a new object.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 10-20-2011, 01:58 AM   #13 (permalink)
Registered Member
 
Join Date: Feb 2011
Location: Bucharest, Romania
Age: 22
Posts: 75
nestedloop is on a distinguished road
Default

@Domele

OFFTOPIC: Dude, congratz! Your app is very very cool. And I love the texts on your site :P especially the one about how you don't lose your job with this app ) Keep up the good work
nestedloop is offline   Reply With Quote
Old 10-20-2011, 02:00 AM   #14 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 32
bialek is on a distinguished road
Default

Thanks, but that means I have no more ideas where the problem can be.
bialek is offline   Reply With Quote
Reply

Bookmarks

Tags
crash, iphone

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 407
15 members and 392 guests
13dario13, 7twenty7, buggen, eski, EvilElf, glenn_sayers, j.b.rajesh@gmail.com, LunarMoon, morterbaher, n00b, QuantumDoja, sacha1996, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:26 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0