NSMutableArray writeToUrl [英] NSMutableArray writeToUrl

查看:60
本文介绍了NSMutableArray writeToUrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用:

[NSMutableArray writeToURL:(NSString *)path atomically:(BOOL)AuxSomething];

为了将文件 (NSMutableArray) XML 文件发送到 url,并更新 url 以包含该文件?

In order to send a file (NSMutableArray) XML file to a url, and update the url to contain that file?

例如:我有一个数组,我想将它上传到特定的 URL,下次应用启动时我想下载该数组.

for example: I have an array and I want to upload it to a specific URL and the next time the app launches I want to download that array.

NSMutableArray *arrayToWrite = [[NSMutableArray alloc] initWithObjects:@"One",@"Two",nil];

[arrayToWrite writeToURL:

[NSURL urlWithString:@"mywebsite.atwebpages.com/myArray.plist"] atomically:YES]; 

在运行时:

NSMutableArray *arrayToRead = 

[[NSMutableArray alloc] initWithContentsOfURL:[NSURL           urlWithString:@"mywebsite.atwebpages.com/myArray.plist"]];

意思是,我想将 NSMutableArray 写入一个 URL,该 URL 位于 Web 托管服务上(例如 batcave.net,该 URL 接收信息并相应地更新服务器端文件.像设置一样的高分,用户发送他的分数,服务器更新它的文件,其他用户在运行时下载高分.

Meaning, I want to write an NSMutableArray to a URL, which is on a web hosting service (e.g. batcave.net, the URL receives the information and updates server sided files accordingly. A highscore like setup, user sends his scores, the server updates it's files, other users download the highscores at runtime.

推荐答案

这里,回答这个问题:
打造高分系统,iPhone 端

我无法编辑我的帖子,因为我以匿名用户的身份在 iPhone 上发帖,抱歉.

I couldn't edit my post because I posted from my iPhone as an anonymous user, sorry.

这篇关于NSMutableArray writeToUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆