0

Now Im sure Im doing something extremely schoolboy here, but Im seriously hitting my head against a wall, for some reason Im getting EXEC_BAD_ACCESS when trying to set an NSNumber property on a custom class. Think Im having one of those days!

Here my test h and m files:

//  Test.h

#import <Foundation/Foundation.h>


@interface Test : NSObject {
    NSNumber *myId;
}

@property (nonatomic) NSNumber *myId;

@end


//  Test.m

#import "Test.h"


@implementation Test

@synthesize myId;

@end

My test is simply:

Test *test = [[Test alloc] init];
test.myId = 1;
iwasrobbed
  • 46,496
  • 21
  • 150
  • 195
Anthony Main
  • 6,039
  • 12
  • 64
  • 89

1 Answers1

3
test.myId = [NSNumber numberWithInt:1];
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345