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?
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?