nscoding issue

Apprentice
Posts: 6
Joined: 2011.05
Post: #1
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
-(id)initWithPosition:(CGPoint)pos inventory:(NSArray*)inv
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2011.05
Post: #3
of course it would be that easy. lol. thank you.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  nscoding a ccsprite shadowgate15 3 5,551 May 26, 2011 01:36 PM
Last Post: Skorche