• 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: MutableArray and TableView Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MutableArray and TableView Question


  • Subject: Re: MutableArray and TableView Question
  • From: Conrad Shultz <email@hidden>
  • Date: Tue, 19 Oct 2010 12:35:52 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/19/10 12:11 PM, Quincey Morris wrote:
> On Oct 18, 2010, at 23:02, Chris Share wrote:
>
>> I'm using an NSMutable array as my data source for the table. The
>> problem I'm having is in clearing the array for each new folder.
>
> You have a conceptual problem here. "Data source" means something
> specific in Cocoa -- an object that implements the
> NSTableViewDataSource protocol. If you're using a data source, then
> the object *isn't* an array (though of course a data source may use
> an array for its backing store, but that doesn't look like what
> you're doing here).

Maybe I overinterpreted the original post, but I was assuming that
inputArray was an instance variable of whatever class the OP's code was
extracted from, and that said class does in fact implement
NSTableViewDataSource.  Is there something in the code that was posted
that suggests otherwise?  (Chris, can you clarify this?)

(My assumption was based on the assertion that the table does sometimes
display data, whereas I think everything would just fall apart if a
simple array was used as the data source, no?)

> and then you shouldn't need to call 'reloadData' at all.

Yes for KVO, but if the architecture is as described above, calling
reloadData would seem to be correct.

I just want to make sure that I'm not missing something that the more
experienced contributors are seeing, as well as making sure that we
don't confuse the OP if they are in fact doing things correctly.

- --
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMvfMYaOlrz5+0JdURAuyLAJ9/wupJhXdovZFN6ESZeYZyRMVtBwCeP8eu
9qOLqPwC8q3db1cJ8+SVMs0=
=lJ9h
-----END PGP SIGNATURE-----
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >MutableArray and TableView Question (From: Chris Share <email@hidden>)
 >Re: MutableArray and TableView Question (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: MutableArray and TableView Question
  • Next by Date: Re: How to create secondary Thread that listens to event taps?
  • Previous by thread: Re: MutableArray and TableView Question
  • Next by thread: Re: MutableArray and TableView Question
  • Index(es):
    • Date
    • Thread