Re: / two questions /
Re: / two questions /
- Subject: Re: / two questions /
- From: Dustin Voss <email@hidden>
- Date: Thu, 17 Jun 2004 10:48:54 -0700
On 17 Jun, 2004, at 9:35 AM, TM Systems::Luis Pojan wrote:
Question number one: i'm trying to populate a NSTableView element in my
interface with the data of a NSMutableArray of NSStrings. I do
[characterScroll setDataSource: theCharacters]; to set the array as its
data source. When I run the app, I get the following: Illegal
NSTableView data source [] Must implement numberOfRowsInTableView: and
tableView:objectValueForTableColumn:row:
I already implemented numberOfRowsInTableView: and
tableView:objectValueForTableColumn:row: but I keep getting the error.
Well, read the error message. It is trying to say that your data source
needs to implement those two methods. If I understand you correctly,
theCharacters is an NSMutableArray, and you are setting the table's
data source to theCharacters. But theCharacters does not implement
those two methods, it is not a valid data source.
You should use either a separate class, or your window controller, as
the table's data source, and probably delegate as well.
Question number two: i'm trying to draw a bar graphic with some data. I
wrote a method in my Graphic class but it doesn't draw a thing when it
is invoked. Can I draw things only if they are in the drawRect: code?
Is there an easier way to do the bar graphic? Later on I'm gonna need
some user interaction with those bars...
Well, I don't know, I've never implemented my own control, but why in
heaven's name aren't you using drawRect:?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.