Re: Table Data and NSArrayController
Re: Table Data and NSArrayController
- Subject: Re: Table Data and NSArrayController
- From: Scott Anguish <email@hidden>
- Date: Tue, 23 Dec 2003 18:07:07 -0500
Yep... here's the problem.
You've got a NSMutableArray that you're storing the array of strings
in. This array is written to the user defaults.
When you read the array from user defaults, you are not getting a
mutable array, you're getting an immutable array. So, when you try to
make changes, you get hosed.
You either need to convert that data to a mutable array through a value
transformer, or write the data out using the value transformer
NSUnarchivedData. The first would be better in defaults as it would be
easily editable, but would require you to write the transformer (not
that it would be a huge effort). The second would require no coding,
but you're defaults get more obscured in the file (which may not be a
bad thing)
On Dec 23, 2003, at 5:21 PM, email@hidden wrote:
>
I have a table whose data is gotten from an NSArrayController. The
>
NSArrayController gets its arranged data from the default user
>
preferences controller, which finds an array of strings. This works
>
perfectly, as the table shows the list of strings stored in the
>
preferences plist. However, when I try to edit the string in the
>
table, my changes take absolutely no effect, and the data reverts to
>
what was retrieved from the plist at first. I even tried changing the
>
preference file during execution, but those changes were overwritten,
>
so the preferences are not being updated.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.