Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 5, 2012, 10:06 AM   #1
mikezang
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
Where to find error for [__NSDictionaryM urlEncodedString]

When I run my app, I got error as below, how and where can I find the reason for this error? please give some suggestion.
Code:
-[__NSDictionaryM urlEncodedString]: unrecognized selector sent to instance 0x9aa43d0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM urlEncodedString]: unrecognized selector sent to instance 0x9aa43d0'
*** First throw call stack:
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote
Old Dec 5, 2012, 10:40 AM   #2
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Look for someplace where you're trying to use a method called urlEncodedString. My guess is you want to call it for an object in a dictionary or array that you think responds to it but it's actually a dictionary.

Don't you have a call stack you can look at to find the methods you called?
ArtOfWarfare is offline   0 Reply With Quote
Old Dec 5, 2012, 10:44 AM   #3
mikezang
Thread Starter
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
Quote:
Originally Posted by ArtOfWarfare View Post
Look for someplace where you're trying to use a method called urlEncodedString. My guess is you want to call it for an object in a dictionary or array that you think responds to it but it's actually a dictionary.

Don't you have a call stack you can look at to find the methods you called?
Thanks for your message. only main in call stacks. But I got a way to trace base on How do I find out what object is "instance 0xfc78f70"

add an Exception breakpoint.
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote
Old Dec 5, 2012, 06:00 PM   #4
Duncan C
macrumors 6502a
 
Duncan C's Avatar
 
Join Date: Jan 2008
Location: Northern Virginia
 
Quote:
Originally Posted by mikezang View Post
Thanks for your message. only main in call stacks. But I got a way to trace base on How do I find out what object is "instance 0xfc78f70"

add an Exception breakpoint.
Right. You want to add an exception breakpoint, for all exceptions thrown from Objective-C (Some system frameworks that are written in C++ throw and catch exceptions internally, and those will cause problems. The security framework in particular gave me fits until I set my exception breakpoint to Objective-C only.

Once you've done that, right-click on the breakpoint in the breakpoints list and select copy to>user. That makes the breakpoint get added to all your projects.

As far as your error, messages that are sent to objects that they shouldn't is usually as sign of an over-release bug (a.k.a. "zombies".) Learn how to use the zombies instrument in instruments to find such bugs.

Alternately you can enable zombies in your debug scheme. Check out this article titled Running Your Application with Diagnostics

You might also try selecting analyze from the product menu to do static analysis on your code. That often finds memory management problems like over-releases and leaks.
__________________
Regards,
Duncan Champney, WareTo.
Check out our latest iOS app, Face Dancer, available for free on the App Store.
Duncan C is offline   0 Reply With Quote
Old Dec 5, 2012, 08:51 PM   #5
mikezang
Thread Starter
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
Quote:
Originally Posted by Duncan C View Post
Right. You want to add an exception breakpoint, for all exceptions thrown from Objective-C (Some system frameworks that are written in C++ throw and catch exceptions internally, and those will cause problems. The security framework in particular gave me fits until I set my exception breakpoint to Objective-C only.

Once you've done that, right-click on the breakpoint in the breakpoints list and select copy to>user. That makes the breakpoint get added to all your projects.

As far as your error, messages that are sent to objects that they shouldn't is usually as sign of an over-release bug (a.k.a. "zombies".) Learn how to use the zombies instrument in instruments to find such bugs.

Alternately you can enable zombies in your debug scheme. Check out this article titled Running Your Application with Diagnostics

You might also try selecting analyze from the product menu to do static analysis on your code. That often finds memory management problems like over-releases and leaks.
Thanks for you advise.
This exception is happened in a library .a file, so I am not sure how to solve it, do you have any idea?
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote
Old Dec 5, 2012, 09:10 PM   #6
Duncan C
macrumors 6502a
 
Duncan C's Avatar
 
Join Date: Jan 2008
Location: Northern Virginia
 
Quote:
Originally Posted by mikezang View Post
Thanks for you advise.
This exception is happened in a library .a file, so I am not sure how to solve it, do you have any idea?
If you pass an object to a library function that has been autoreleased too many times, you can get that behavior.

Run analyze and zombies on your app as I suggested.
__________________
Regards,
Duncan Champney, WareTo.
Check out our latest iOS app, Face Dancer, available for free on the App Store.
Duncan C is offline   0 Reply With Quote
Old Dec 6, 2012, 12:03 AM   #7
mikezang
Thread Starter
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
Quote:
Originally Posted by Duncan C View Post
If you pass an object to a library function that has been autoreleased too many times, you can get that behavior.

Run analyze and zombies on your app as I suggested.
I found the reason for this exception as below
Code:
To use the SDK in your app, the -ObjC value needs 
to be added to the "Other Linker Flags" setting 
in your Xcode project. See this article for more details: 
Apple Technical Q&A QA1490"
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
"Safari can't find the server" error coming up frequently MacMan988 OS X Mavericks (10.9) 1 Nov 17, 2014 10:43 PM
Challenge: Try to find what's wrong with my iTunes app (error 13014) dastinger Mac Applications and Mac App Store 14 Feb 6, 2014 08:08 AM
Error on boot up - Unable to find drive for this platform MacNoob815 MacBook Air 2 Oct 16, 2013 08:51 AM
Can't find bootable drive after software update.Tried CMD+R and error -6003F occurred Mito MacBook Air 11 May 31, 2013 09:50 AM
iTunes Error Message - Can't find Playlist kirky29 Mac Applications and Mac App Store 2 Sep 23, 2012 03:21 PM

Forum Jump

All times are GMT -5. The time now is 11:58 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC