ios - Appdelegate.m 抛出错误
问题描述
我正在尝试在 xcode 上运行我的 react-native 项目,但不幸的是它开始为 Appdelegate.m 文件引发错误。
抛出的三个错误是:
方法“应用程序:didFinishLaunchingWithOptions:”的重复声明
预期表达
使用未声明的标识符“中心”
我尝试删除 appdelegate.m 文件以查看构建是否会刷新,但不幸的是它仍然抛出错误。下图为问题代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
// Define UNUserNotificationCenter
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
return YES;
}
任何建议将不胜感激。该项目整个上午都在工作,似乎最近刚刚离开。
解决方案
推荐阅读
- reactjs - 如何在本机反应中对 svg 图像进行灰度化?
- c++ - 基于窗口位置的 Direct X 裁剪位图并将其渲染回窗口
- postgresql - SQL 错误:错误:未处理所有令牌
- python - 无法在 TensorFlow 中完全分离模型的输出
- laravel - 'composer require jenssegers/mongodb' 将 MongoDB 添加到新的 Laravel 7 项目时出错
- amazon-web-services - 预定义组的 AWS S3 对象级 ACL
- typescript - 为什么在将字符串与空值进行比较时,TS 不会说“此条件将始终返回 'false'”?
- javascript - React/TS 在一种方法上显示 YYYY/MM/DD
- assembly - 下面列出的最后一行弹出了什么值?
- javascript - 如何在特定的快递路线上设置不同的 bodyparser