我试图Array像这样加载我的 s,但它只是先加载,Array而其他的则不显示。
    - (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    NSString *path = [[documentPaths lastObject] stringByAppendingPathComponent:@"test.plist"];
    NSDictionary *myDict = [NSDictionary dictionaryWithContentsOfFile:path];
    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"blackKey"])
    {
        NSArray *black = [myDict objectForKey:@"Black"];
        self.tableData = [black copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"greenKey"])
    {
        NSArray *green = [myDict objectForKey:@"Green"];
        self.tableData = [green copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"purpleKey"])
    {
        NSArray *purple = [myDict objectForKey:@"Purple"];
        self.tableData = [purple copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"orangeKey"])
    {
    NSArray *orange = [myDict objectForKey:@"Orange"];
        self.tableData = [orange copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"blueKey"])
    {
        NSArray *blue = [myDict objectForKey:@"Blue"];
        self.tableData = [blue copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"redKey"])
    {
        NSArray *red = [myDict objectForKey:@"Red"];
        self.tableData = [red copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"darkblueKey"])
    {
        NSArray *darkblue = [myDict objectForKey:@"Darkblue"];
        self.tableData = [darkblue copy];
    }
    else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"yellowKey"])
    {
        NSArray *yellow = [myDict objectForKey:@"Yellow"];
        self.tableData = [yellow copy];
    }
    }
- 我做错了什么? 
- 另外,我想将数组标题显示为部分标题,怎么做? 
- 有没有办法限制每个部分的行数(我的数组)?
编辑
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [tableData count];
}
// 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:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    NSDictionary *dict = [tableData objectAtIndex:indexPath.row];
    cell.textLabel.text = [NSString stringWithFormat:@"%@ - %@", [dict objectForKey:@"Name"], [dict objectForKey:@"Address"]];
    return cell;
}
编辑2
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    [sectionsTitle objectForKey:[sectionTitle objectAtIndex:indexPath.section]];
}
使用未声明的标识符“indexPath”;你的意思是“NSIndexPath”吗?