Cocoa touch Cocoa Touch-分段控制

Cocoa touch Cocoa Touch-分段控制,cocoa-touch,Cocoa Touch,如何获取分段控件中选择的内容?使用selectedSegmentIndex 编辑: 要检索段的标题,请将此NSInteger传递到titleForSegmentAtIndex:。请注意,如果selectedSegmentIndex未返回正值,则将其用于titleForSegmentAtIndex将导致错误

如何获取分段控件中选择的内容?

使用
selectedSegmentIndex

编辑:
要检索段的标题,请将此
NSInteger
传递到
titleForSegmentAtIndex:
。请注意,如果
selectedSegmentIndex
未返回正值,则将其用于
titleForSegmentAtIndex
将导致错误