I have the following code :
var myBundle:NSBundle
myBundle = NSBundle.mainBundle() // what is the role of this line ??
if let path = myBundle.pathForResource("CellDescriptor", ofType: "plist"){
var cellDescriptors: NSMutableArray!
cellDescriptors = NSMutableArray(contentsOfFile: path)
}
Why am I using this line of code myBundle = NSBundle.mainBundle()
? I read that it is initialising myBundle
object. But what does that exactly mean?
Why cannot I call pathForResource
function without initialising myBundle
object?
Thank you.