• 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: Table Data and NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Table Data and NSArrayController (From: email@hidden)
 >Re: Table Data and NSArrayController (From: Scott Anguish <email@hidden>)
 >Re: Table Data and NSArrayController (From: email@hidden)
 >Re: Table Data and NSArrayController (From: Scott Anguish <email@hidden>)
 >Re: Table Data and NSArrayController (From: Daryn <email@hidden>)

  • Prev by Date: Re: Table Data and NSArrayController
  • Next by Date: Distinguishing clicks on NSSegmentedControl segments
  • Previous by thread: Re: Table Data and NSArrayController
  • Next by thread: Re: Table Data and NSArrayController
  • Index(es):
    • Date
    • Thread