Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DavidCar

macrumors 6502a
Original poster
Jan 19, 2004
525
0
Simple XCode Question

I'm quite new to XCode, C and Objective C. I am trying to port an old project from THINK Pascal. I've got the "15 minute text editor" from Apple documentation up and running. I've successfully added a MyDocument class, and I'm starting on a MyTreeItem class. I've answered various questions through the built in documentation, but I've run into a problem that may be too fundamental to easily find in the documentation.

This is generally what I am trying to port:

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

UNIT ParserManager;

INTERFACE
Uses ParserDefs;

Function MyParser(hPE: PEHandle; var hTree; MyTreeHandle): BOOLEAN;

IMPLEMENTATION
Uses ParserProcs;

Function MyParser(hPE: PEHandle; var hTree; MyTreeHandle): BOOLEAN;
BEGIN
MyParser := FALSE;
hTree := NIL;
END

END.

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

So I am expecting in XCode to have a file called ParserManager.h which contains

#import <Cocoa/Cocoa.h>
#import "ParserDefs.h"
#import "MyTreeItem.h"

(BOOL) MyParser(NSString *Str, MyTreeItem **tree);


... and a file called ParserManager.m which contains

#import "ParserProcs.h"

(BOOL) MyParser(NSString *Str, MyTreeItem **tree) {
return NO;
}

... and my file MyDocument.m would contain


#import "ParserManager.h"

...

NSString *Str;
MyTreeItem *tree;

if (MyParser(Str, &tree)) {
// set flag
};

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

I must be failing to navigate a paradigm shift here, because XCode doesn't get what I want it to do. Would enlightened ones be redefining MyParser as a class, or what?
 

DavidCar

macrumors 6502a
Original poster
Jan 19, 2004
525
0
Complaint about vague compiler error messages

I found my problem, which was just a trivial omission rather than something as grand as missing a paradigm shift. If the complier had given me a clearer error message I would not have had to spend hours trying to find the source of the problem.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.