objective c - How can jump another tab with a single click on a button? -



objective c - How can jump another tab with a single click on a button? -

-(void)save{ mainscreencontoller *main= [[mainscreencontoller alloc] initwithnibname:@"mainscreencontoller" bundle:nil]; [self.view.superview addsubview:[main view]];

}

this place going click , button calls save function.after want application automatically turn main screen first tab bar 1 third.

so click button , application switches first tab bar.

try setting property of uitabbarcontroller:

@property(nonatomic) nsuinteger selectedindex

so first tab, like:

self.tabbarcontroller.selectedindex = 0;

from documentation:

setting property changes selected view controller 1 @ designated index in viewcontrollers array. select more navigation controller itself, must alter value of selectedviewcontroller property instead.

objective-c view uitabbarcontroller

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -