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: Wain <email@hidden>
- Date: Thu, 24 Nov 2005 20:21:04 +0000
On 24 Nov 2005, at 20:00, Steve Gran wrote:
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.
Thanks,
Steve
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
I will assume that you have completed up to here...
and by making sure that only 10 items are in the
content array that your NSArrayController uses.
and that this is the section you don't follow...
Note that I don't have a copy of the book so I am making assumptions:
I'm guessing you have some object which is the owner of the interface
builder (nib) file - "File's Owner",
hopefully this object has access to the data you want to display,
this data should be placed into an NSArray (or NSSet) which we'll
call dataArray
in interface builder go to the 'Bindings' info pane for your
NSArrayController which is supplying data to the table view
connect, or more rightly, bind the 'contentArray' or 'contentSet'
binding to "File's Owner (Owner name)" with model key path "dataArray"
Hope this is clear enough...
Wain
___________________________________________________________
WIN ONE OF THREE YAHOO! VESPAS - Enter now! - http://uk.cars.yahoo.com/features/competitions/vespa.html
_______________________________________________
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