Call a function in AppDelegate?

前端 未结 4 661
暖寄归人
暖寄归人 2020-12-19 13:14

Following the solution (the highest-voted answer actually) at UITextField Example in Cocos2d, I managed to do it except the line

[[[UIApplication sharedAppli         


        
4条回答
  •  难免孤独
    2020-12-19 14:07

    -[UIApplication delegate] returns an object of type id, so the compiler only knows the methods that objects of that type respond to, even thought your custom delegate responds to specifyStartLevel. You can either ignore the warning, or cast the return value of -[UIApplication delegate]:

    [(YourCustomAppDelegate *) [[UIApplication sharedApplication] delegate] specifyStartLevel];
    

提交回复
热议问题