I am new to Swift and am using Xcode 6.
I am attempting to read data from the app's plist
file, but it is not working.
The data.plist
file is included in Xcode's Supporting Files
group.
I am using the code below:
var dataList = NSDictionary(contentsOfURL:NSBundle.mainBundle().URLForResource("data", withExtension:"plist"))
however the NSURL:
NSBundle.mainBundle().URLForResource("data", withExtension:"plist")
always returns nil
.
I don't know what is wrong.