Parse errors when declaring local variables.
Parse errors when declaring local variables.
- Subject: Parse errors when declaring local variables.
- From: Tim James <email@hidden>
- Date: Tue, 11 Feb 2003 01:03:26 -0800 (PST)
I'm new to programming in Objective-C and have not been able to figure out why
I am getting parse errors in some IB-generated code. I specified specific
class types for outlets in IB (as opposed to "id"), and when I generated the .h
and .m files, these became pointers to the appropriate classes. However, it
would just say, "Parse error before <classname>," whereas switching these
declarations to type id corrects the problem. While I'm happy it works, I am
confused as to why it doesn't work with the class name. Here are the two files
that matter:
/* FileDragTableView.h */
#import <Cocoa/Cocoa.h>
#import "MainWindowController.h"
@interface FileDragTableView : NSTableView {
IBOutlet MainWindowController *controller;
BOOL tableIsHighlighted;
}
// Bunch of method declarations here.
@end
/* MainWindowController.h */
#import <Cocoa/Cocoa.h>
#import "FileDragTableView.h"
@interface MainWindowController : NSObject {
IBOutlet FileDragTableView *mp3Table;
}
// Method declarations here.
@end
I get a "parse error before "FileDragTableView"" message (or "parse error
before "MainWindowController,"" in the other file). When I switch the class
pointers to just "id," it works.
Tim
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
_______________________________________________
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.