Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c UITableView更改样式_Objective C_Ios_Uitableview_Storyboard - Fatal编程技术网

Objective c UITableView更改样式

Objective c UITableView更改样式,objective-c,ios,uitableview,storyboard,Objective C,Ios,Uitableview,Storyboard,我有一个uitableView,其中包含我以编程方式创建的不同节和行 当我点击一行时,我将进入新视图,在导航栏的新视图中,我有canel按钮 使用“取消”按钮时,它应该像“后退”按钮一样工作,但当我单击“取消”时,它会加载表格,但会将表格样式从“组”更改为“普通” 提前谢谢 有人知道为什么吗 你能帮帮我吗 我想知道它为什么会改变。 我应该添加什么才能拥有相同的样式 这是我的密码: 在第一个表中,我通过编程和故事板添加了样式 - (id)initWithStyle:(UITableViewStyl

我有一个uitableView,其中包含我以编程方式创建的不同节和行

当我点击一行时,我将进入新视图,在导航栏的新视图中,我有canel按钮 使用“取消”按钮时,它应该像“后退”按钮一样工作,但当我单击“取消”时,它会加载表格,但会将表格样式从“组”更改为“普通”

提前谢谢

有人知道为什么吗

你能帮帮我吗 我想知道它为什么会改变。 我应该添加什么才能拥有相同的样式

这是我的密码:

在第一个表中,我通过编程和故事板添加了样式

- (id)initWithStyle:(UITableViewStyle)style
{
style = UITableViewStyleGrouped;
self = [super init];
if (self) {
    self = [super initWithStyle:style];
    monthTitle = [[NSMutableArray alloc] init];
}
return self;
}
按钮代码

-(void)cancelItem{
Report *report = [[Report alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:report animated:YES];
[self.tableView reloadData];

}
编辑

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
_selectedIndex = indexPath.section;
[self.tableView reloadData];
switch (indexPath.section){
    case 0:
        [self performSegueWithIdentifier:@"WorkTime" sender:self];

我们可以将样式设置为

[[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];

如何显示第二个表?@janufidel-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(nsindepath*)indepath{u selectedIndex=indepath.section;[self.tableView reloadData];switch(indepath.section){case 0:[self performsguewithidentifier:@“WorkTime”发送方:self]@Janusfiel我在上面添加了编辑功能。您是否使用导航控制器推送新视图???