views:

41

answers:

1

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;
+3  A: 
test.myId = [NSNumber numberWithInt:1];
Alex Reynolds
the prop name is myId! but ultimately yes, he is trying to assign a primitive to an object. /whoops
Jasconius
/me slaps head, of course, think I've been at the keyboard this week too long!
tigermain