• 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: Question regarding NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question regarding NSTableView


  • Subject: Re: Question regarding NSTableView
  • From: Philipp Ringli <email@hidden>
  • Date: Wed, 2 Feb 2005 23:12:39 +0100

Thanks a bunch!
I should have looked at the end of the turorial... I was testing too early. :)


Phil

On 02.02.2005, at 23:03, Robert Cerny wrote:

hi Philipp,
when you make an object a datasource of tableview, you MUST implement numberOfRowsInTableView and objectValueForTableColumn methods exactly as the exception says.
Check http://www.cocoadev.com/index.pl?search=NSTAbleView


HTH
Robert


On 2.2.2005, at 22:44, Philipp Ringli wrote:

I getting this error message:

[Session started at 2005-02-02 22:26:06 +0100.]
2005-02-02 22:26:08.472 MTASC-X[1650] *** Illegal NSTableView data source (<Controller: 0x353110>). Must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:


I have connected the NSViewTable in IB.
Class Controller has these Attributes:

Outlets:
Outletname: classPathTable Type: id (couldn't this be NSTableView?)

Actions:
addRecord:
saveRecords:
deleteRecords:

In NSTableView Info Panel I have an outlet DataSource -> Controller

In Controller (Custom) Info Panel I have an outlet classPathTable -> NSTableView(Classpath, Active)


These are excerpts of code from the respective files:

in my Controller.h:
------------------------------------------------
NSMutableArray *classPathRecords; // an array holding dictionary Objects
IBOutlet id classPathTable; // Ref to View: NSTableView (NIB)


- (IBAction)addRecord:(id)sender;
- (IBAction)saveRecords:(id)sender;
- (IBAction)deleteRecords:(id)sender;

in my Controller.m:
------------------------------------------------
// Handling Classpath Table

-(NSDictionary *)createRecord
{
  NSMutableDictionary *record = [NSMutableDictionary dictionary];
  [record setObject:@"Please enter Classpath..." forKey:@"classpath"];
  return record;
}

- (IBAction) addRecord:(id) sender
{
	[classPathRecords addObject:[self createRecord]];
	[classPathTable reloadData];
	NSLog (@"\nclassPathTable:%@", classPathTable);
}

- (IBAction) deleteRecords:(id) sender
{
}

- (IBAction) saveRecords:(id) sender
{
}


-(void)awakeFromNib { classPathRecords = [[NSMutableArray alloc] init]; }

-------------------------------------------------


I am *very* new to cocoa, and objective-c. (...you might have already noticed. ;-) )
Any tip is welcome.



Thanks for reading, Phil



_______________________________________________
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




_______________________________________________ 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
References: 
 >Question regarding NSTableView (From: Philipp Ringli <email@hidden>)
 >Re: Question regarding NSTableView (From: Robert Cerny <email@hidden>)

  • Prev by Date: Open application when Options button is clicked
  • Next by Date: [AppleScript Studio] Table View
  • Previous by thread: Re: Question regarding NSTableView
  • Next by thread: difference between frameworks and plugins
  • Index(es):
    • Date
    • Thread