• 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
NSArrayController, custom objects, user defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController, custom objects, user defaults


  • Subject: NSArrayController, custom objects, user defaults
  • From: Yann Bizeul <email@hidden>
  • Date: Thu, 5 Feb 2004 15:06:59 +0100

Helo list.

A couple of questions about this obscure thing named ObejctController that seem to be not so used at this time.

Two concrete cases we have problem to use :

First one :
-------------

Use NSArrayController to store custom classes, and store them into NSUserDefaults.
There is no problem using NSArrayController to manage custom objects, once the application is launched, I can add, delete, and manager object properties via different kind of controls.
But as soon as I want to store this into NSUserDefaults, I get this error :

-[NSKeyValueSlowMutableArray bytes]: selector not recognized

NSKeyValueSlowMutableArray is unknown to me, seem to be a private class, and I did not find a solution to this, I tried to make my class NSCodr womplient without sucess.

Second one :
-----------------

Almost the same, but without a custom object, just an NSMutableDictionary as my NSArrayController's "Object class Name" (this is the default). This time, I can create (add) objects, but not modify properties, I get a :

-[NSCFDictionary setObject:forKey:]: mutating method sent to immutable object

and this is absolutely unusable. Preferences are saved, since when I re-open the application, I get each time one more epty object in the tableview I binded to the NSArrayController.

Conclusion
---------------

What's the point of NSUserDefaults with NSArrayController ? Is there a way to make them work together ?

--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
_______________________________________________
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: NSArrayController, custom objects, user defaults
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: ObJC vs. Java -- NEWBIE
  • Next by Date: Re: ObJC vs. Java -- NEWBIE
  • Previous by thread: Re: Sound manipulation in Cocoa
  • Next by thread: Re: NSArrayController, custom objects, user defaults
  • Index(es):
    • Date
    • Thread