これが私のコードです。plistのコンテンツをテーブルに表示しようとしていますが、エラーが発生し続けます。私は一日中それをしていたので、私はおそらくかなり簡単なものを逃しています。私がビルドするときにテーブルが空である理由を皆さんが理解できることを願っています。
これが私のplistです(ヘッダーなし):
<array>
<dict>
<key>word</key>
<string>AWord1</string>
<key>definition</key>
<string>here is a definition</string>
<key>partOfSpeech</key>
<string>here is a part of speech</string>
</dict>
<dict>
<key>word</key>
<string>Bword1</string>
<key>definition</key>
<string>here is a definition</string>
<key>partOfSpeech</key>
<string>here is a part of speech</string>
</dict>
</array>
</plist>
編集:フォーマットミスのために終了タグが欠落していた-修正済み
わかった。これが私の新しいコードです。私はNSLogを実行し、plistに移動する前にバックアップすることにしました。だから、あなたが助けることができれば。代わりにこのデータをplistからプルすることをどのように提案しますか(データがplistにあると仮定します)
//Initialize the array.
listOfItems = [[NSMutableArray alloc] init];
NSArray *countriesToLiveInArray = [NSArray arrayWithObjects:@"Iceland", @"Greenland", @"Switzerland", @"Norway", @"New Zealand", @"Greece", @"Italy", @"Ireland", nil];
NSDictionary *countriesToLiveInDict = [NSDictionary dictionaryWithObject:countriesToLiveInArray forKey:@"Countries"];
NSArray *countriesLivedInArray = [NSArray arrayWithObjects:@"India", @"U.S.A", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", @"Test", nil];
NSDictionary *countriesLivedInDict = [NSDictionary dictionaryWithObject:countriesLivedInArray forKey:@"Countries"];
[listOfItems addObject:countriesToLiveInDict];
[listOfItems addObject:countriesLivedInDict];
//Initialize the copy array.
copyListOfItems = [[NSMutableArray alloc] init];
//Set the title
self.navigationItem.title = @"Countries";
//Add the search bar
self.tableView.tableHeaderView = searchBar;
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
searching = NO;
letUserSelectRow = YES;
plistからのデータを解析するように実際に指示していないように感じます。私はそれを初期化しただけです。考え?