NSDate *future = [NSDate dateWithString:@"2010-12-25 00:00:00 -0600"];
Run Code Online (Sandbox Code Playgroud)
我收到一条警告信息:NSDate可能没有回应+dateWithString
有任何想法吗?
Root ---- Array
Item 0- Dictionary
fullName ---- String
address ---- String
Item 1 ---- Dictionary
fullName ---- String
address ---- String
我有一个看起来像那个的plist.在一个视图中我有一个按钮,当点击时我想添加一个新的"第2项"或3或4或5等...我只想添加更多的名称和地址.
我今晚花了3个小时寻找完美的例子但是很短暂.Apple财产列出的样本太深了.我见过可能会接近的代码.
非常感谢
NSMutableDictionary *nameDictionary = [NSMutableDictionary dictionary];
[nameDictionary setValue:@"John Doe" forKey:@"fullName"];
[nameDictionary setValue:@"555 W 1st St" forKey:@"address"];
NSMutableArray *plist = [NSMutableArray arrayWithContentsOfFile:[self dataFilePath]];
[plist addObject:nameDictionary];
[plist writeToFile:[self dataFilePath] atomically:YES];
Run Code Online (Sandbox Code Playgroud)
- (NSString *)dataFilePath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"children.plist"];
return path;
}
NSMutableDictionary *nameDictionary = [NSMutableDictionary dictionary]; …
我的SDK版本是"最新",表示4.2,另一个设置为3.0.App Loader给了我这个错误.
Apple目前不接受使用此版本SDK构建的应用程序.
XCode版本3.2.5
有线索吗?