Protocol for Table View Trouble
Protocol for Table View Trouble
- Subject: Protocol for Table View Trouble
- From: Eric Lee <email@hidden>
- Date: Wed, 6 Aug 2008 00:43:36 -0500
I've been having trouble implementing some protocols for table view. I
just copied and pasted from my other code into this .m file, changed
the variables so that it matched the variables in the .h file, but it
has 6 errors, and I can't find out why!
Here's the .m file:
#import "drawerTableView.h"
@implementation drawerTableView
- (IBAction)makeDrawerVisible:(id)sender
{
[drawer setLeadingOffset:0];
[drawer setTrailingOffset:0];
[drawer openOnEdge:1];
[itunessongs initWithSource:@"Users/ericlee/Desktop/Development/Watch/
getitunessongs.scpt"];
[drawerTableView reloadData];
}
- (IBAction)makeDrawerGone:(id)sender
{
[drawer close];
}
- (NSInteger)numberOfRowsInTableView:aTableView
{
if ([itunesArray isEqual:drawerTableView]) { //says there's a
"error:syntax error before 'drawerTableView'
return [itunesArray count];
}
return [itunesArray count]; //says error:syntax error before 'return'
}
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(NSInteger)rowIndex
{
if ([itunesArray isEqual: drawerTableView]) {//says error:syntax
error before 'drawerTableView'
return [itunesArray objectAtIndex:rowIndex];
}
return [itunesArray objectAtIndex:rowIndex]; //says error:syntax
error before 'return'
}
- (void)tableView:(NSTableView *)anotherTableView
setObjectValue:(id)anObject
forTableColumn:(NSTableColumn *)anotherTableColumn
row:(NSInteger)rowIndex
{
if ([itunesArray isEqual: drawerTableView]) { //says error: syntax
error before 'drawerTableView'
[itunesArray replaceObjectAtIndex:rowIndex withObject:anObject];
}
} //says there's an "error: syntax error before '}' token
@end
Thanks!
The problem parts are highlighted in green (sorry if you can't read
it :( )
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden