1

我有一个UIImagePicker,当你点击一个按钮时,虽然我最近添加了一个选项,使用段可以使用相机,虽然我似乎无法检查哪个段被选中。这是我目前得到的代码:如何检查使用UISegmentedControl选择哪个段

- (IBAction)addPicture:(id)sender { 
    if (_photoControl.selected == 0) { 
     CGRect rect = CGRectMake(0, 0, 753, 118); 
     [popOverController presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; 
    } else { 

    } 
} 

尽管if语句总是如此。

这可能是真正明显的做什么,虽然我很难过。

在此先感谢

回答

3

使用selectedSegmentIndex,不selected

+0

非常感谢 – Hive7