Subclassing a View Controller in a Storyboard
Subclassing a View Controller in a Storyboard
- Subject: Subclassing a View Controller in a Storyboard
- From: Dave <email@hidden>
- Date: Wed, 04 Sep 2013 10:23:04 +0100
Hi All,
If I am using a Storyboard that contains a view controller, LTWMusicViewController that I'd like to sub-class like so:
LTWRockMusicViewController : LTWMusicViewController
Then in the viewDidLoad method, do:
-(void) viewDidLoad
{
[super viewDidLoad];
self.pMusicCategory = kRockMusicCategory;
}
----------------------------
At present LTWMusicViewController is loaded using:
myViewController = [self.storyboard instantiateViewController:@"LTWMusicViewController"];
I want LTWRockMusicViewController to use same NIB etc, as LTWMusicViewController, but just pre-set the self.pMusicCategory property to Rock.
How do I do this using a Storyboard? I don't really want to copy all the controls for LTWMusicViewController into LTWMusicViewController.
Thanks in advance,
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden