In the following OS X application, how can I create a Dictionary in a similar way to how I create an NSDictionary?
I suppose I need to find a method on Dictionary that performs the same task as NSDictionary(contentsOfFile:infoPlist) but I am not sure what this Dictionary method is.
import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(aNotification: NSNotification?) {
var infoPlist = "/Applications/Calendar.app/Contents/Info.plist"
var nsDictionary = NSDictionary(contentsOfFile:infoPlist)
println("nsDictionary = \(nsDictionary)")
var dictionary = Dictionary<String, String>()
// TODO: How do I add entries from "infoPlist" to "dictionary"
// like I do above with the old "nsDictionary"?
println("dictionary = \(dictionary)")
}
func applicationWillTerminate(aNotification: NSNotification?) {
}
}
Many thanks in advance.