I've login button at the top of the bar with a header login when the user clicks the app on the English I want I'll logout the show instead of the same button after login but this title is not changing. Here's the code that I'm using You can do something like this: .m your isCLikedLogins is
NSString for the first time it does not assume the login is clicked on this Yes.
if ([appDelegate.isClickedLogin isEqualToString: @ "yes"]). {SignIn_BarButton = [[UIBarButtonItem alloc] initWithTitle: @ "logout" style: UIBarButtonItemStyleBordered goal: self action: @selector (login user)]; } Else {signIn_BarButton = [[UIBarButtonItem alloc] initWithTitle: @ "connected" style: UIBarButtonItemStyleBordered goal: self action: @selector (loginUser)]; Self.navigationItem.rightBarButtonItem = signIn_BarButton; }
Check BOOL Login;
- (zero) visible app: (BOOL) animated {loginCheck = YES; Self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: @ "English" style: UIBarButtonStyleBordered goal: self action: @selector (loginPressed)}
login < / Code> Method:
- Login (login) Check {self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: @ "Logout" style: UIBarButtonStyleBordered Target: Self-action : @selector (loginPressed)} else {self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: @ "connected" style: UIBarButtonStyleBordered goal: self action: @selector (loginPressed)} loginCheck = loginCheck} < ! / Pre>
Friday, 15 June 2012
iphone - How to make the title of UIBarButtonItem Logout after the first time button is clicked -
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment