iphone - 如何在分段控件中获取所选分段的标题?

标签 iphone objective-c

所选段的类显示为 UISegment,我找不到对其的类引用。肯定有办法访问与所选索引关联的标题吗?

最佳答案

来自 UISegmentedControl文档:

NSString * selectedTitle = [mySegmentedControl titleForSegmentAtIndex:[mySegmentedControl selectedSegmentIndex]];

关于iphone - 如何在分段控件中获取所选分段的标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2798552/

相关文章:

iphone - UITableView中的UILabel设置大小

iPhone 标签栏应用程序 : Is it possible to add subview inside the tabbar (on top of it)?

ios - 使用 iOS 7 检索设备 WiFi MAC 地址

objective-c - NSArray 中包含的模型上的 KVO

objective-c - 如何拥有不同的 NSManagedObjectContext?

Iphone 变量似乎正在加载语法而不是变量

iphone - 将静态库附加到 iphone/ipad 应用程序

iphone - UIView 意外进入状态栏下方

iphone - 将 UIImageView 添加到 UIView

ios - 如何使用 Firebase 在 UITableViewController 中正确显示数据?