• 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: A weird parse error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A weird parse error


  • Subject: Re: A weird parse error
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Thu, 20 May 2004 15:04:15 -0700

Hello...

As joar recommended, it would really help make your code easier to read if you capitalized the first letter of classes, but that it up to you.

It's probably more of a problem that the internal capitalization varies between the class names and the source files. You mentioned that you fixed the capitalization for memberDatasource, but matchDatasource and meetingDatasource have the same problem. Whatever style you decide to use, the most important thing is to be consistent.


1) Have you tried removing most of the #import statements in the header file and replacing them with the @class directive? Usually you will only import the relevant headers that are necessary for your superclass (and typedef'ed enums, etc...) in the header file, and import the other headers that your code uses in the classes .m file instead.

(In the examples below I've used the naming style that I normally use, but however you do it, consistency is the key. I've left mysql alone since I'm not sure if it is your file or part of the mysql library, but if it is your class, it might be better to call it by some other name and use consistent capitalization instead)

In other words, in AppController.h

#import <Cocoa/Cocoa.h>
@class mysql, Toolbar, MemberDatasource, MatchDatasource, MeetingDatasource;

Then, in AppController.m

#import "AppController.h"

#import "mysql.h"
#import "Toolbar.h"
#import "MemberDatasource.h"
#import "MatchDatasource.h"
#import "MeetingDatasource.h"


2) Are you getting other errors or warnings when you compile? There may be some other error or warning from something in one of the other header files that is also causing the error in this particular location even though there doesn't seem to be anything wrong there.


Hope that helps,

Louis


I get: Parse error before "memberDatasource" the line which triggers
the error is pretty well marked :)


here's appController.h

#import <Cocoa/Cocoa.h>
#import "mysql.h"
#import "toolbar.h"
#import "memberDataSource.h"
#import "matchDataSource.h"
#import "meetingDataSource.h"
...
-Fjvlnir Asgeirsson
-Aptiva
_______________________________________________
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.


  • Prev by Date: Does not execute on launch
  • Next by Date: Re: Default Mail/Web apps
  • Previous by thread: Re: A weird parse error
  • Next by thread: Code style guidelines
  • Index(es):
    • Date
    • Thread