Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在plist字符串中添加变量_Ios_Swift_Variables_Plist - Fatal编程技术网

Ios 在plist字符串中添加变量

Ios 在plist字符串中添加变量,ios,swift,variables,plist,Ios,Swift,Variables,Plist,我想在plist字符串中添加一个变量。有可能吗 e、 g.在数组中的项0中。字符串是“今天是XXXXX” 在我的swift文件中,我能够加载plist和字符串。但是如何将变量插入到plist字符串中呢?我应该如何输入plist以及在swift文件中编码什么 谢谢希望这能有所帮助 var myDict: NSDictionary? if let path = NSBundle.mainBundle().pathForResource("Config", ofType: "plist") {

我想在plist字符串中添加一个变量。有可能吗

e、 g.在数组中的项0中。字符串是“今天是XXXXX” 在我的swift文件中,我能够加载plist和字符串。但是如何将变量插入到plist字符串中呢?我应该如何输入plist以及在swift文件中编码什么

谢谢

希望这能有所帮助
var myDict: NSDictionary?
if let path = NSBundle.mainBundle().pathForResource("Config", ofType: "plist") {
    myDict = NSDictionary(contentsOfFile: path)
}
if let dict = myDict {
    // Use your dict here
}