开发者

UIButton as back button, without addSubView

开发者 https://www.devze.com 2023-02-05 02:23 出处:网络
i have two views 1st one is displaying list (uitableview used), user will select one row from list and go to 2nd view

i have two views 1st one is displaying list (uitableview used), user will select one row from list and go to 2nd view

in 2nd view i am colleting data from server and displaying data on label or text field

now in second view I hide my back button(navigation bar) and add new UIbutton as Discon开发者_Python百科nect(using interface builder)

so when user press on this Disconnect button he should move back to 1st view.

but without [self.view addSubView:1stview.view]; --- because this one is not working as what i want.

Thank you in advance


@pooja add this code in your 2nd View and you please connect this IBAction to you disconnect button

    (IBAction) moveToFist {
[self.navigationController popViewControllerAnimated:YES];
}


On that disconnect button's IBaction method

write

[self.navigationController popViewControllerAnimated:YES]; 
0

精彩评论

暂无评论...
验证码 换一张
取 消