Re: Table Data and NSArrayController
Re: Table Data and NSArrayController
- Subject: Re: Table Data and NSArrayController
- From: Scott Anguish <email@hidden>
- Date: Thu, 25 Dec 2003 01:36:14 -0500
I'm not sure that you can count on this behavior working long term.
This sounds like a bug/loophole, and I'd not count on it working in
production code.
On Dec 24, 2003, at 6:55 PM, Daryn wrote:
>
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.
[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.