I have a UIView subclass that I'd like to instantiate from a NIB file. I've been using this method to do it:
UINib *nib = [UINib nibWithNibName:@"SSNodeToolsView" bundle:[NSBundle mainBundle]];
self = [[[nib instantiateWithOwner:self options:nil] objectAtIndex:0] retain];
...and indeed this creates the object correctly and links everything up. However, the object instantly loses access to its delegate. The delegate is declared in the usual way:
id delegate
@property (nonatomic, assign) id delegate
@synthesize delegate
...and so on. However when the object loads from its nib the delegate instantly becomes null and ignores any attempt to assign values to it. Oddly this doesn't cause a crash. Can anyone tell me why this is? I'd prefer to use the nib-loading method since these elements of my app are likely to be redesigned quite frequently and it would be easiest to do that using a nib.
-Ash