Re: Newbie needs help with tableview and bindings
Re: Newbie needs help with tableview and bindings
- Subject: Re: Newbie needs help with tableview and bindings
- From: Brian Smith <email@hidden>
- Date: Thu, 24 Nov 2005 14:53:52 +0800
On Nov 24, 2005, at 2:30 PM, Steve Gran wrote:
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
_______________________________________________
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