ドキュメント フォルダーから Plist を読み込んでいます。7 つのレコードがあります... 以下を確認してください: しかし、私のマスター ビュー テーブルには 5 つしか表示されず、これは "numberOfRowsInSection : return [accounts count] ... コード以下、どこかに欠けているものがありますか... 設定はありますか: 注: データは架空のものです
Account = (
"BOA Mortgage",
"Citibank Visa",
HOA,
"Toyota Finance",
"CitiBank Account",
West,
"Wells Fargo"
);
Balance = (
"5678.00",
1099,
"145.00",
"21000.00",
"4500.00",
1200,
450
);
DayDue = (
8,
3,
6,
26,
5,
3,
23
);
MinAmount = (
"1899.00",
"1200.00",
"329.00",
"583.84",
"225.00",
45,
35
);
Number = (
"8837430-002",
"29932843-00",
45225028,
452308582345,
25390403232,
1234578,
1234566
);
}
- (void)viewDidLoad
{
NSLog(@"loading data");
self.navigationItem.title=@"Accounts";
// NSString *accountFile = [[NSBundle mainBundle] pathForResource:@"Accounts2" ofType:@"plist"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentPath = [paths objectAtIndex:0];
NSString *plistPath = [documentPath stringByAppendingPathComponent:@"Accounts2.plist"];
accounts = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
NSLog(@"Accounts contains : %@", accounts);
account = [accounts objectForKey:@"Account"];
NSLog(@"account %@", account);
number = [accounts objectForKey:@"Number"];
dueDay = [accounts objectForKey:@"DayDue"];
minAmount = [accounts objectForKey:@"MinAmount"];
balance = [accounts objectForKey:@"Balance"];
NSLog(@"data loaded");
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
self.navigationItem.rightBarButtonItem = addButton;
}
ここに私のcellForRowAtIndexPathからのコードがいくつかあります...それも5しか返していません
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
NSDate *object = _objects[indexPath.row];
cell.textLabel.text = [object description];
NSString *nameOfAccount = [account objectAtIndex:indexPath.row];
cell.textLabel.text = nameOfAccount;
NSString *accountNumber = [number objectAtIndex:indexPath.row];
cell.detailTextLabel.text = accountNumber;
NSLog(@"Index %d", indexPath.row);
return cell;
}