Linus
Linus

Reputation: 4783

(UITabBarController *)self.window.rootViewController;

I've seen this declaration in a tutorial where someone is changing the appearance of the UITabBarController.

UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;

What does the first part after the equal sign do? To be more specific, the

(UITabBarController *)

By the way, is there some kind of overview of which classes are relevant when changing the UI appearance? I'm having a hard time figuring out when to call what.

Thanks a lot!

Upvotes: 0

Views: 264

Answers (1)

user529758
user529758

Reputation:

This is a typecast: the (T)value operator forces an explicit type conversion from the original type of value to the new type T.

Upvotes: 1

Related Questions