I'm hoping this is a simple question, as I'm very new to cocoa. I created an object which has a UIImageView as a property. I set the property within another procedure, e.g.
Bleep* bleep = [[Bleep alloc]init];
bleep.heading = heading;
bleep.distance = distance;
bleep.instanceId = instanceId;
...
bleep.imgView = [[UIImageView alloc] initWithFrame:CGRectMake(x, y, bleepImg.size.width, bleepImg.size.height)];
No error is thrown, but imgView
is nil (0x0). What behavior would cause this? I am creating the bleep object, setting value types just fine, but this object doesn't seem to want to hold anything.
My classes:
@interface Bleep : NSObject {
}
@property float x;
@property float y;
@property float distance;
@property int instanceId;
@property UIImageView* imgView;
@property float heading;
@end
@implementation Bleep
@synthesize x;
@synthesize y;
@synthesize distance;
@synthesize instanceId;
@synthesize heading;
@synthesize imgView;
@end