• 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: Bindings/NSUserDefaultsController issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings/NSUserDefaultsController issue


  • Subject: Re: Bindings/NSUserDefaultsController issue
  • From: Loukas Kalenderidis <email@hidden>
  • Date: Mon, 12 Mar 2007 10:48:16 +1100

On 09/03/2007, at 2:51 AM, Keary Suska wrote:

on 3/7/07 9:46 PM, email@hidden purportedly said:

At this point I should
mention that "Device" is a subclass of NSMutableDictionary. The
objects seem to get stored in NSUserDefaults fine - I can see encoded
data when I `defaults read <domain>` from the command line, but my
subclass's initWithCoder: and encodeWithCoder: implementations are
never called. The objects appear to be NSMutableDictionarys when I
`po [device class]` (where "device" is a reference to one of these
objects - the same thing happens if I do something like `po
[[[devicesController arrangedObjects] objectAtIndex:0] class]`). So
it seems like the "Object Class Name" field is being ignored and the
array controller is creating NSMutableDictionarys.

I am not sure if you followed, or were involved in the recent thread
regarding subclassing collection objects. In short, you are aware that you
can't subclass an NSDictionary like any other object? Just checking, since
attempting to do so will cause unexpected behavior, as well as hangs and
crashes.


If you *have* properly subclassed an NSMutableDictionary, I am inclined to
think that the issue lies in your subclass, since it would have to be
somewhat complex.


There may be other issues, but this is a good place to start.


Thanks again Keary. The main problem turned out to be something so stupid that I won't mention it. I missed that thread the first time round but I went back and read it and changed the class to store a dictionary as a member variable and overload KVC methods instead. I found the problem _after_ I did this so I'm not sure if it would have worked the other way, but it sounds like it would have been a bad idea anyway.


Cheers,
Loukas
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Re: Bindings/NSUserDefaultsController issue (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Framework project config & accessing resources in the framework bundle.
  • Next by Date: performclose vs close
  • Previous by thread: Re: Bindings/NSUserDefaultsController issue
  • Next by thread: NSTokenfield: Drag and Drop / Autocompletion
  • Index(es):
    • Date
    • Thread