• 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: / two questions /
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >/ two questions / (From: "TM Systems::Luis Poján" <email@hidden>)

  • Prev by Date: Re: sin(4*pi^2*t) 0 >= t <= pi/3, can you read this ?
  • Next by Date: Re: Scrolling List of Thumbnails?
  • Previous by thread: Re: / two questions /
  • Next by thread: Bindings and 'failed assertion'
  • Index(es):
    • Date
    • Thread