I have a twitterlogeout button when the user sucessfully logs in the username of the twitter will appear in the logoutbutton.my code for that is
- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username {
NSLog(@"Authenicated for %@", username);
[_btntwitterLogeout setTitle:username forState:UIControlStateNormal];
}
but i want to set a condition if the _btntwitterLogeout.title = nil then ……. do some thing
but i didnt know how to set condition if there is no title in the logout button.
i put this code,but no luck
if (_btntwitterLogeout.titleLabel.text == nil) {
_btntwitterLogeout.hidden = YES;
_btnTwitter.hidden=NO;
}
else {
_btntwitterLogeout.hidden = NO;
_btnTwitter.hidden=YES;
}
How can I do this?
Try this one: