- (void)viewDidLoad
{
[super viewDidLoad];
[self.segmentedControl removeAllSegments];
s = 0;
for (NSDictionary *dictionary in self.top.segments) {
[_segmentedControl insertSegmentWithTitle:dictionary [@"sTitle"] atIndex:s animated:NO];
self.bioTextView.text = [NSString stringWithFormat:@"%@", dictionary [@"sData"]];
}}
為什麼segmentedControl以顛倒的順序開始?請高手指點。謝謝
變量 s的值一直為0 ,沒有在執行完成後累加
for (NSDictionary *dictionary in self.top.segments) {
[_segmentedControl insertSegmentWithTitle:dictionary [@"sTitle"] atIndex:s animated:NO];
self.bioTextView.text = [NSString stringWithFormat:@"%@", dictionary [@"sData"]];
s++; //這裡來累加
}}