For more info on fix this error, see here
I'm trying to make blackjack in objective C, and am having trouble passing objects around. My Hand class basically takes a deck and draws cards from it, adding them to an array.
Here's the Hand methods involved:
- (id)init : (Deck*) deck
{
[self draw: deck];
[self draw: deck];
return self;
}
- (void)draw: (Deck*)deck;
{
Card* C= [deck drawFromDeck];
[cards addObject: C];
}
Here's the problematic part of main:
Deck* deck=[[Deck alloc] init];
Hand* hand=[[Hand alloc] init: deck ];
The second line of that gets the "integer from pointer without a cast" error. Whenever I run the code, the hand never has cards in it because there's no deck to draw from (I think :) ). Do I need to pass or parse the Deck* differently? (if you need me to post any more code, just ask)
Thanks guys!! :D