• 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: Newbie needs help with tableview and bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie needs help with tableview and bindings


  • Subject: Re: Newbie needs help with tableview and bindings
  • From: Steve Gran <email@hidden>
  • Date: Thu, 24 Nov 2005 12:00:12 -0800

Thanks Brian that helps. I now know how to limit the view to just those items I want.

But how do I get to load the tableview with an array containing 10 items without the use of an "Add item" button (action). I'm really hoping someone can provide a real step by step guide since I'm such a beginner. Unfortunately mmalc's answer was no help at all. I'm sure a real engineer would understand what he was talking about and his examples on his website but I'm not even close to that.

Thanks,

Steve


> Anyway, the issue I'm having is creating a very simple tableview > using bindings and NSArrayController (like the example in > Hillegass' book in Ch 6. I want the table to have a static number > of rows (10). Most (actually all) of the examples in books and the > web show a tableview whose rows are created with an action (like a > "create" button by the user). > > But what I would like is just a 3 column by 10 row table that the > user (me) can enter text into. Think of it as a top ten list that > should always have ten items (or rows at least). I don't want to > have to click an "Add New Item" button 10 times every time I start > the app. How do I get this done using bindings and the > NSController? I've done a bunch of searching on the web and can't > seem to find an answer.


You can accomplish this by setting up your table view in Interface Builder to show 3 column by 10 rows and turn off showing the vertical scrollers. Eventhough the table view can display more than 10 items, you will control it by not allowing it to scroll thus limiting the display of 10 items and by making sure that only 10 items are in the content array that your NSArrayController uses. Another way of saying this is you limit the data to 10 items which will limit the table view to 10 rows.

Regards,
Brian


>>This is not a bindings issue -- it's data initialisation. Create the >>data set in whatever init method is appropriate for your >>application. See <http://homepage.mac.com/mmalc/CocoaExamples/ >>controllers.html> for a couple of examples.

>>mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Newbie needs help with tableview and bindings
      • From: mmalcolm crawford <email@hidden>
    • Re: Newbie needs help with tableview and bindings
      • From: Wain <email@hidden>
  • Prev by Date: Re: is a repetitive use of imageNamed: bad?
  • Next by Date: Re: Cross platform development: Was: Deprecated methods in NSDocument
  • Previous by thread: Re: Newbie needs help with tableview and bindings
  • Next by thread: Re: Newbie needs help with tableview and bindings
  • Index(es):
    • Date
    • Thread