• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trapping insert nil value into dictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Trapping insert nil value into dictionary?
      • From: "Ben Kennedy" <email@hidden>
References: 
 >Re: Trapping insert nil value into dictionary? (From: Don Yacktman <email@hidden>)

  • Prev by Date: Re: How to get system version?
  • Next by Date: Re: Trapping insert nil value into dictionary?
  • Previous by thread: Re: Trapping insert nil value into dictionary?
  • Next by thread: Re: Trapping insert nil value into dictionary?
  • Index(es):
    • Date
    • Thread