以编程方式更改UISegmentedControl标题

she*_*ebi 2 xcode objective-c uisegmentedcontrol

如何以编程方式更改UISegmentedControl标题?请你帮助我好吗?

@synthesize filterControl; //UISegmentedControl

- (void)viewDidLoad
{
    [super viewDidLoad];

    filterControl = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"ALL",@"PROFIT",@"LOSS", nil]]; //not working

}
Run Code Online (Sandbox Code Playgroud)

oly*_*ise 6

只是用

-setTitle:(NSString*)title forSegmentAtIndex:(NSUInteger)index;
Run Code Online (Sandbox Code Playgroud)