What does [NSBundle mainBundle] mean on iPhone?

RootViewController *rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];

Sometimes I see that he uses nil, I don’t know what exactly is it used for?

+3
source share
2 answers

Here is the exact explanation:

Set to search for nib file. This method nib file in the package of project language directories first, then the Resources directory. If nil, this method looks for the nib file in the main package.

I think that [NSBundle mainBundle] does nothing else except you set to zero. However, if you want to do internationalization and localization, you can use them

More here

+1
source

Source: https://habr.com/ru/post/1757759/


All Articles