Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.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 初始化UISegment控件_Objective C_Iphone - Fatal编程技术网

Objective c 初始化UISegment控件

Objective c 初始化UISegment控件,objective-c,iphone,Objective C,Iphone,我想将uisegement控件初始化为第二个选项。因此,当单击按钮时,我想将uisegement控件设置为选项2 - (IBAction)buttonPressed { mySegmentedControl.selectedSegmentIndex = 1; // 2nd item }

我想将uisegement控件初始化为第二个选项。因此,当单击按钮时,我想将uisegement控件设置为选项2

- (IBAction)buttonPressed {
    mySegmentedControl.selectedSegmentIndex = 1; // 2nd item
}