0

很抱歉,如果以前曾多次问过这个问题,但似乎对我的问题没有任何帮助。

我已将我的应用程序设置为从应用程序本身内部完美读取本地 .plist 文件以进行测试,但要使该应用程序有任何用途,我需要能够在 Web 服务器上更新它并远程加载它.

这是我当前的本地 plist 代码。我将如何在应用程序的其他地方进行最小的更改来修改它?

提前谢谢了。

- (void)viewDidLoad
{
    [super viewDidLoad];

    //Create a dictionary with the contents of Squad.plist
    NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Squad" ofType:@"plist"]];

    //Fill the Squad array with contents of dictionary under the key "Players"
    [self setSquad:(NSArray*) [dictionary objectForKey:@"Players"]];

    //Reload the table data
    [[self tableView] reloadData];

    [[self navigationItem] setPrompt:nil];
}
4

1 回答 1

1

您需要先下载远程.plist,同时显示加载或其他内容,下载后,像现在一样在本地使用它。没有办法远程阅读它。

于 2012-12-11T12:28:36.357 回答