For some or other reason when I call the init method and try and set the property it never seems to work:
//This is where I am setting the value
Hotel *newHotel = [[Hotel alloc]initWithCoordinate: coordinate
hotelId:[NSNumber numberWithInt:1234]];
//This is the implementation of the method I am calling
- (id)initWithCoordinate:(CLLocationCoordinate2D)c hotelId:(NSNumber *)hId
{
self = [super init];
coordinate = c;
hotelId = hId; //When I access this property afterwards its always out of scope
return self;
}
//This is the interface
@interface Hotel : NSObject <MKAnnotation>
{
NSNumber *hotelId;
}
@property (nonatomic, retain) NSNumber *hotelId;
- (id)initWithCoordinate:(CLLocationCoordinate2D)c hotelId:(NSNumber *)hotelId;
@end