Re: ImageAndTextCell editing problem
Re: ImageAndTextCell editing problem
- Subject: Re: ImageAndTextCell editing problem
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 16 Dec 2010 21:10:26 -0700
On Dec 16, 2010, at 12:35 AM, Fernando Valente wrote:
> Hey,
>
> I got ImageAndTextCell and I'm using it on a NSOutlineView. When I double click a cell in order to edit it, I get the following error:
>
> 2010-12-16 05:31:54.399 MyApp[26823:a0f] -[NSCFString representedObject]: unrecognized selector sent to instance 0xa0aff968
>
> Does anyone know a solution for that?
If you're having a problem with an exception being raised due to a nonsensical message being sent to an object, then the problem is usually caused by one of the following:
1. Your code is sending a message to an object not declared as id that does not respond to that message, which should raise a compiler warning, but either you ignored it or your project has warnings turned off.
2. Your code is dynamically forwarding the message without first checking to see if it responds to that message. This will not cause a compiler warning.
3. Your application is messaging a deallocated object, and you got lucky, because some other object (in the above case, an NSString) moved into its old address. Under normal circumstances, this would cause a crash.
To fix these:
1. Make sure "-Wmost" is in your target's other warnings build setting. (You can be more pedantic if you wish, but I find that -Wmost covers most bases, along with the default warnings.) And don't ignore build warnings unless you know what you're doing.
2. Break on objc_exception_raise and try to reproduce the problem in the debugger. And if this is the problem, then use -respondsToSelector: to find out if objects or classes support a message prior to sending.
3. Run your app in Instruments with the zombie detection instrument, then try to reproduce the problem.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden