cocoa touch - Is initWithNibName and initWithCoder method of UIView or UIViewController? -
it seems saw them in both. funny given not inherit 1 another. have common ancestor, 1 owns initwithcoder , iniwwithnibname?
so gives?
also in uiviewcontroller reference class initwithcoder not mentioned @ all
-(id)initwithcoder:(nscoder *)adecoder { //nsstring * superclass =nsstringfromclass([self superclass]) ; self = [self initwithnibname:nil bundle:nil]; if (self) { } return self; }
questions should start search in reference docs.
initwithnibname:bundle:
method of uiviewcontroller
, no other class (other classes extend uiviewcontroller
).
initwithcoder:
method declared in nscoding
protocol. class (and there many) conform nscoding
protocol have initwithcoder:
method. both uiview
, uiviewcontroller
implement nscoding
protocol means both classes have initwithcoder:
.