我想知道是否有办法远程写入存储在我的服务器上的 plist 文件。文件所在的目录具有写入权限,但我似乎无法推送新数据。这是我的代码:
NSString *accountURL = [NSString stringWithFormat:@"http://www.mywebsite.com//%@.plist",txtUsername.text];
NSURL *url = [NSURL URLWithString:accountURL];
NSMutableDictionary *account = [[NSMutableDictionary alloc] initWithContentsOfURL:url];
[account setObject:@"TEST" forKey:@"LastLogin"];
if ([account writeToURL:url atomically:NO]){
NSLog(@"saved");
}else{
NSLog(@"not saved");
}
plist 文件存在是因为我可以毫无问题地从中读取。我只是无法写入文件。
另一方面,如果帐户将存储在我的服务器上,这是否甚至对 AppStore 友好?