I am an Objective C newbie and I'm sure this is an easy question but I can't figure this out: I have a class which declares an instance variable called myDeck, which is part of a custom class I created called Deck. Right now I have this in my code:
In the @interface:
Deck *myDeck;
In my init method:
Deck *ourDeck = [[Deck alloc]init];
myDeck = ourDeck;
So this seems to create the myDeck just fine, and I can stick values in it and run it's methods for a while, but I'm running into a spot where it ceases to exist and I get an EXC_BAD_ACCESS error when trying to use it.
I have tried adding
[myDeck retain];
to no avail, it still fails in the same spots. I don't really know how I should be alloc and initting this, I have a feeling I am missing something, anyone?