[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Set_c createEnd problem
From: |
Bohdan Durnota |
Subject: |
Re: Set_c createEnd problem |
Date: |
Fri, 06 Dec 1996 15:38:07 +1100 (EST) |
>
>
> Bohdan -- in response to your question about Set_c:
>
> In the case of Set, the name you should send createBegin: to is just
> Set, not Set_c. Set is a special "factory" object that is published
> in the library header file (collections.h), which is the only header
> file you should ordinarily include to use this library. (Single header
> files summarizing all the publicly visible interface are in process of
> being established for additional libraries). When you send createBegin:
> to Set, it does not send the message to the compiled version of Set_c,
> but to a different class generated to contain just the create phase
> behavior. That's most likely while you're crashing. It's all part of
> internal implementation machinery that a caller isn't supposed to have
> to deal with.
>
> Your code should work if you change it from:
>
> > Set_c * aSet;
> >
> > aSet = [Set_c createBegin: [self getZone]];
> > [aSet createEnd];
>
> to:
>
> Set aSet;
>
> aSet = [Set createBegin: [self getZone]];
> aSet = [aSet createEnd]; // aSet could be a new id, in some versions
>
> This code, with no messages between createBegin/End, has the same effect as:
>
> Set aSet;
>
> aSet = [Set create: [self getZone]];
>
>
> Roger Burkhart
>
Ta, Got all that.
Now, if I have in my header file
#import <collections.h>
@interface ....
....
- (Set *) xxxxxx;
I get a parse error at the - (Set *) line.
If I id the Set return type, and have in my implementation file
#import <collections.h>
@implementation ...
...
- (Set *) xxxxx {
.... }
I also get a parse error at that line (and also Set undeclared error
when I try to declare a variable to be of type Set).
It all seems that Set is not being found.
Any suggestions?
Thanks again, Bohdan