我正在尝试将UISegmentedControl
放在Navigation Item
上,但它会导致我的xcode崩溃..我只是将UISegmentedControl
添加到Interface Builder文件(IB)文件中,然后添加到{{ 1}}
·H
viewDisAppear
.m
IBOutlet UISegmentedControl *segmentedControl;
这只是让我的xcode崩溃了
self.navigationItem.titleView=segmentedControl;
libc ++ abi.dylib:终止调用抛出异常
为什么会出现此错误
答案 0 :(得分:2)
UISegmentedControl * seg1 = [[UISegmentedControl alloc]
initWithItems:[NSArray arrayWithObjects:@"von mir", @"alle", nil]];
[seg1 setSegmentedControlStyle:UISegmentedControlStyleBar];
self.navigationItem.titleView = seg1;