There is no such method. initcomes from NSObject, so every object can use it, and subclasses define their own initialization methods. UIView, for example, defines initWithFrame:and, in addition, from the protocols there are init methods, such as NSCodingwhich defines initWithCoder:. This is the dynamic nature of objective-C, everything can be expanded at any time. That being said, there are several models. UIViewControlleralmost always accepts initWithNibName:bundle:, but UIViewalmost always accepts initWithFrame:or initWithCoder:. What I am doing is making an internal initialization method, and just calling other calls.
- (void)initialize
{
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if(self)
{
[self initialize];
}
}
- (id)initWithCoder:(NSCoder *)aCoder
{
self = [super initWithCoder:aCoder];
if(self)
{
[self initialize];
}
}
source
share