Parsing through this document on class clusters, NSNumber
implements initWithChar:
in roughly the following manner:
- (id)initWithChar:(char)c
{
[self release];
return [[__NSCharNumber alloc] initWithChar:c];
}
Similarly, you could use this pattern for initializing views from a Nib:
- (id)initWithFrame:(CGRect)frame
{
id realSelf = [[self class] nib] instantiateWithOwner:nil options:nil][0];
realSelf.frame = frame;
[self release];
return realSelf;
}
I'm wondering, does ARC manage the releasing of the unreturned self
in these cases? Is it documented anywhere?