lets imagine this scenario:
Game.h:
@interface Game : CCLayer
{
NSMutableArray* questions;
}
@property (nonatomic,retain) NSMutableArray* questions;
- (void) didLoadFromCCB;
- (void) pressitem:(id)sender;
@end
Game.m
@implementation Game
@synthesize questions;
- (void) didLoadFromCCB
{
NSMutableArray *questions = [[NSMutableArray alloc] initWithObjects:[NSNumber numberWithInteger:-1],nil];
NSLog(@"didload %@", questions);
}
- (void) pressitem:(id)sender
{
NSLog(@"pressitem %@",questions);
}
@end
I get the log from didLoadFromCCB but on the pressitem it returns null. Shouldn't the array be accessible through all my implementation?
I know this seams like a really noob question, but i come from an actionscript/php background, and i just ordered a C and an Objective C book, but while i wait i just wanted to dig in a little.
thank you for your time :)