ModyFiy it according to You........ ... Save Bool Type Variable for Login Status In Yor Login View Controller....
-(void)viewWillAppear:(BOOL)animated
{
BOOL isLogin=[[NSUserDefaults standardUserDefaults]boolForKey:@"LoginUser"];
if (isLogin==YES)
{
[logoutBtn removeTarget:self action:@selector(loginAndRegister) forControlEvents:UIControlEventTouchUpInside];
[logoutBtn addTarget:self action:@selector(logout) forControlEvents:UIControlEventTouchUpInside];
}
else
{
[logoutBtn removeTarget:self action:@selector(logout) forControlEvents:UIControlEventTouchUpInside];
[logoutBtn addTarget:self action:@selector(loginAndRegister) forControlEvents:UIControlEventTouchUpInside];
}
[self willAnimateRotationToInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation duration:1.0];
}