Search code examples
iosiphoneobjective-cselectornstimer

Undeclared selector warnining in ios 7


I'm tying create a welcome label using NSTimer but its showing the through some warnings

like

undeclared selector hidelable and unused variable timer

I have not used the NSTimer before can one pls tell me where im doing wrong and wt is the right method to do it.I need to give a welcome message when app load after few minities it has to disappear

i have tried this one im not able to get pls help me

this is the code i have to used in the view didload

NSTimer  * timer = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(hideLabel:) userInfo:nil repeats:NO];

in storyboard i have used ib label which i want to display message

@property (strong, nonatomic) IBOutlet UILabel *wel;

please any one tell wt is proper way to make this one..


Solution

  • you have not declared hideLabel method.hence it gives that warning

    [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(hideLabel:) userInfo:nil repeats:NO];
    
    -(void)hideLabel:(NSTimer *)timer{
     myLabel.hidden=YES;
    }