I have segmented control described in XIB (in storyboard exactly) and has reference to controller class. I am trying to change segmented control titles according to language, but I can’t change it. When i log my segmented control, it says it don’t have any segments, even I have made them in XIB or create programatically. Does anybody know whats wrong?
code:
NSLog(@"segments:%d", [segmentControl numberOfSegments]);
[segmentControl removeAllSegments];
[segmentControl insertSegmentWithTitle:@"stuff" atIndex:0 animated:NO];
[segmentControl insertSegmentWithTitle:@"other stuff" atIndex:1 animated:NO];
NSLog(@"segments:%d", [segmentControl numberOfSegments]);
both logs outputs shows zeroes
I found that problem was not i code, but in storyboard itself (I played half day with localization)
I found that even I had one storyboard, but it being in en.Iproj made mess (looks like another language couldn’t reach it). I took it out to main folder and now everything works again.