Accessing _tabBarItem from the initializer


#1

I’ve read more than once that it’s not recommended to use accessors from initializer methods, but we are doing just that in HypnosisViewController to get the tabBarItem and setting its properties:

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
	self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
	if (!self) return nil;
	
	UITabBarItem *tbi = [self tabBarItem];
	[tbi setTitle:@"Hypnosis"];
	
	return self;
}

Instead, if I try to access the backing instance variable I get a compiler error when building the target:

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
	self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
	if (!self) return nil;
	
 	[_tabBarItem setTitle:@"Hypnosis"];
	
	return self;
}

Shouldn’t we configure tabBarItem’s properties on viewDidLoad? Thank you!