iDevGames Forums
nscoding issue - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: nscoding issue (/thread-8995.html)



nscoding issue - shadowgate15 - May 24, 2011 08:13 PM

no matter what i try i can't seem to get this phrase to work:

Code:
- (id) initWithCoder:(NSCoder *)decoder{
    return [self initWithPosition:[decoder decodeCGPointForKey:kPositionKey]
                        inventory:[decoder decodeObjectForKey:kInventoryKey]];
}

i get an "incompatible type for argument 1" error

here is my initwithposition method

Code:
-(id) initWithPosition:(CGPoint *)pos inventory:(NSArray *)inv{
    if ((self = [super init])) {
        self.inventory = inv;
        self.position = pos;
    }
    
    return self;
}

where i also get an error of "incompatible type of argument 1 of 'setPosition:'" on the self.position line.


RE: nscoding issue - OneSadCookie - May 24, 2011 08:30 PM

-(id)initWithPosition:(CGPoint)pos inventory:(NSArray*)inv


RE: nscoding issue - shadowgate15 - May 24, 2011 08:45 PM

of course it would be that easy. lol. thank you.