.m
The NSLogs are not appearing (being reached) in console. I haven't done anything with UISegmentedControls and I haven't found any good information about it. Even in sample code, it isn't pertaining to switching (adding/removing/hiding) views. I had an even harder time finding anything pertaining to how to handle this is IB. I basically scrapped this through scratch, so I expected errors, but I got none. I just didn't get any result either
Anybody who helps - thanks for the help (PS, if the implementation is fine, I would appreciate what I should do with IB for this. I am 99.9% sure my header is good to go (how couldn't it be, haha). I did give each view it's own class, FYI). Thanks in advance.
Code:
- (IBAction)segaction:(id)sender
{
UISegmentedControl *segmentedcontrol = (UISegmentedControl *) sender;
NSInteger selectedSegment = segmentedcontrol.selectedSegmentIndex;
if (selectedSegment == 0) {
NSLog(@"A loaded");
[subview1 setHidden:NO];
[subview2 setHidden:YES];
[subview3 setHidden:YES];
}
if (selectedSegment == 1) {
NSLog(@"B loaded");
[subview1 setHidden:YES];
[subview2 setHidden:NO];
[subview3 setHidden:YES];
}
if (selectedSegment = 2) {
NSLog(@"C loaded");
[subview1 setHidden:YES];
[subview2 setHidden:YES];
[subview3 setHidden:NO];
}
}
The NSLogs are not appearing (being reached) in console. I haven't done anything with UISegmentedControls and I haven't found any good information about it. Even in sample code, it isn't pertaining to switching (adding/removing/hiding) views. I had an even harder time finding anything pertaining to how to handle this is IB. I basically scrapped this through scratch, so I expected errors, but I got none. I just didn't get any result either