• 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: NSTableView Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView Problems


  • Subject: Re: NSTableView Problems
  • From: Barry Fawthrop <email@hidden>
  • Date: Sun, 23 Nov 2008 19:21:16 -0500

Thank You
 my datasource methods are as follows:

-(int) numberOfRowsInTableView:(NsTableView *)table {
   return [schedule count];
}

-(id)talbeview: (NSTableView *)table objectValueForTableColumn:
(NSTableColumn *)col: row:(int)row {
   return [schedule objectAtIndex: row];
}

Can/Should I perhaps add a second controller, this time an Array
Controller (the current one is NSObject based),
And use just the Array Controller for the NSTableView ?

Would this met your suggestion on a object class?

Thanks again
Barry

Graham Cox wrote:
>
> On 24 Nov 2008, at 10:43 am, Graham Cox wrote:
>
>>> [schedule addObject: [NSArray arrayWithObjects: @"TIME", filename,
>>> length, nil]];
>
>
> A further comment.
>
> While managing your data this way is OK, and may fit your application
> well, I personally wouldn't do it this way.
>
> Instead, define an object class that has a filename, length and time
> values as properties. Then your list becomes trivially easy to manage as
> each related piece of data is always held together. In other words a
> general-purpose array is not a good substitute for a custom object that
> links the various bits of data together meaningfully.
>
> You'll also find that driving a table view is much easier - the code
> snippet I posted always works when you do it this way, provided your
> write your property accessors correctly.
>
>
> hth,
>
>
> Graham
>
>

_______________________________________________

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

  • Follow-Ups:
    • Re: NSTableView Problems
      • From: Barry Fawthrop <email@hidden>
    • Re: NSTableView Problems
      • From: Alexander Spohr <email@hidden>
    • Re: NSTableView Problems
      • From: Graham Cox <email@hidden>
References: 
 >NSTableView Problems (From: Barry Fawthrop <email@hidden>)
 >Re: NSTableView Problems (From: Graham Cox <email@hidden>)
 >Re: NSTableView Problems (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: MVC in Cocoa?
  • Next by Date: Re: NSXMLElement -stringValue and whitepsace
  • Previous by thread: Re: NSTableView Problems
  • Next by thread: Re: NSTableView Problems
  • Index(es):
    • Date
    • Thread