Re: Trapping insert nil value into dictionary?
Re: Trapping insert nil value into dictionary?
- Subject: Re: Trapping insert nil value into dictionary?
- From: "Ben Kennedy" <email@hidden>
- Date: Fri, 17 Oct 2003 12:11:13 -0400
- Organization: Zygoat Creative Technical Services
On 17 10 2003 at 2:10 am -0400, Don Yacktman wrote:
>
It's a private Foundation Kit class. You'll have to either create your
>
own dummy header to include or use the class-dump program to create one
>
(my preferred approach). To do the latter, download class-dump, since
>
it doesn't come with Mac OS X, and then run it on the binary file
>
inside of Foundation.framework to expose all the private methods and
>
classes. Excerpt the part(s) you need, since it will give you a dump
>
of *everything*.
Thanks for the suggestion Don, I've now done this. However, it's not
working and I don't understand why.
First of all, I have verified that poseAsClass: is properly taking
effect, since I've added a dummy +[ test] method to my NSCFDictionary
subclass, and calling [NSCFDictionary test] invokes it. However,
setObject:forKey isn't taking; it's as though I haven't even overridden
the method. I've used exactly the signature as provided by class-dump.
Curiously though, the log output during my deliberate nil insertion now reads:
2003-10-17 12:04:51.252 Doggiebox[2248] Exception raised during posting
of notification. Ignored. exception: *** -[%NSCFDictionary
setObject:forKey:]: attempt to insert nil value
This is exactly the same output as when I do not do poseAsClass, with the
addition of the leading percent sign before the class name. What's up
with that?
-ben
--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.