0
我正在檢查xcode中plist文件中是否存在密鑰。 我的plist文件具有這種結構。如何檢查plist中是否存在密鑰?
Root (Dictionary)
+- Parent1 (Dictionary)
- Key1 (Boolean)
- Key2 (Boolean)
- Key3 (Boolean)
- Key4 (Boolean)
+- Parent2 (Dictionary)
- Key1 (Boolean)
- Key2 (Boolean)
現在我需要檢查Key2是否存在於Parent1中?我檢查了NSDictionary但無法得到如何做到這一點。
有關如何做到這一點的任何建議?
'BOOL key2Exists = [subDict objectForKey:@「Key2」];'will do; '!= nil'位是多餘的。 – 2010-09-27 09:38:30
輝煌,工作,謝謝:) – raziiq 2010-09-27 09:41:51
@Williham:如果不使用!=零,警告出現,所以我想它更好用!=零 – raziiq 2010-09-27 09:43:41