Re: Table Data and NSArrayController
Re: Table Data and NSArrayController
- Subject: Re: Table Data and NSArrayController
- From: Daryn <email@hidden>
- Date: Wed, 24 Dec 2003 17:55:54 -0600
What happens is that setValue:withKey: gets called on the strings with
a key of @"". KVC magic will eventually look for a selector of
"set<Key>:", so the easiest solution is this:
@implementation NSMutableString (MyStringAdditions)
- (void)set:(id)value { [self setString:value]; }
@end
Just make sure the controller is set to manage object class
NSMutableString and everything works great.
On Dec 23, 2003, at 11:48 PM, Scott Anguish wrote:
>
you're correct - it's not the whole story, mmalc reminded me that there
>
are issues with trying to use NSString's in an array directly. Try
>
instead putting them into an NSDictionary, and add each NSDictionary to
>
the array.
>
>
it adds little extra effort (declare NSMutableDictionary as the type
>
for the NSArrayController - use a named key to refer to the object, so
>
selected.theKey), and obfuscates the defaults a bit)
>
>
>
>
On Dec 24, 2003, at 12:28 AM, email@hidden wrote:
>
>
> I don't think that this is the case, or at least the whole case. I can
>
> still add anything to the NSArrayController. I overrode the add:
>
> method
>
> with:
>
>
>
> - (void)add: (NSObject*)sender
>
> {
>
> [self addObject: @"Hello"];
>
> }
>
>
[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.
[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.