• 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
Parse errors when declaring local variables.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Parse errors when declaring local variables.
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: Can't make window.
  • Next by Date: Problems with SecKeychainOpen
  • Previous by thread: Re: cocoa-dev digest, Vol 2 #1923 - 13 msgs
  • Next by thread: Re: Parse errors when declaring local variables.
  • Index(es):
    • Date
    • Thread