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 に答える