我正在尝试将app名称用作NavController标题,但无论我做什么,我都无法获得CFBundleDisplayName值.它返回'null'.
这是我正在使用的代码
[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"]
Run Code Online (Sandbox Code Playgroud)
已检查的捆绑包=只有一个.Xcode5/dev目标是iOS5.我没有检查过设备.使用模拟器.
谢谢!
有没有办法减少Obj-C中重复声明的代码?
例如:
我有
localNotification.fireDate = self.dueDate;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = self.text;
localNotification.soundName = UILocalNotificationDefaultSoundName;
Run Code Online (Sandbox Code Playgroud)
它可以简化为这样的东西吗?
localNotification
.fireDate = self.dueDate;
.timeZone = [NSTimeZone defaultTimeZone];
.alertBody = self.text;
.soundName = UILocalNotificationDefaultSoundName;
Run Code Online (Sandbox Code Playgroud)
谢谢!