How mainBundle() return on object in swift or objective-c? -


i reading book related ios development. , facing problem when reading line let bundle = nsbundle.mainbundle(). book told

this call returns bundle object represents our application.

i know, in swift object created let objname = classname() . please tell how let bundle = nsbundle.mainbundle() create object?

this call not create (instanciate) new object. calls mainbundle class method on nsbundle class, returns singleton, main bundle of app.

similar calls (in obj-c, translatable in swift easily):

  • [uiapplication sharedapplication]
  • [nsnotificationcenter defautcenter]

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -