提问人:Nat Rajan 提问时间:9/23/2016 最后编辑:ajay_nasaNat Rajan 更新时间:9/23/2016 访问量:547
在 xcode 8 中初始化 Appdelegate 对象
Initializing Appdelegate Object in xcode 8
问:
在 xcode 8 中初始化 appdelegate 对象会引发警告。以下语法是否有问题
AppDelegate *del=[[UIApplication sharedApplication]delegate];
答:
0赞
Jitendra Modi
9/23/2016
#1
我给你另一个选项来使用 Appdelegate 对象并在 appdelegate.h 文件中贴花它,如下所示
#define theAppDelegate \
((AppDelegate *)[UIApplication sharedApplication].delegate)
希望这工作正常
评论
AppDelegate
UIAppDelegate
AppDelegate *del= (AppDelegate *)[[UIApplication sharedApplication]delegate];
AppDelegate