ios - 隐藏不需要的日志打印 - 在 Xcode 9 中

标签 ios warnings xcode9

我已经将 OS_ACTIVITY_MODE 设置为禁用,但是在迁移到 Xcode 9 之后,打印了一些不需要的日志,如下所示。

编辑:我已经提到了 Hide strange unwanted Xcode logs , 但在 Xcode 9 中对我不起作用。

================================================================= Main Thread Checker: UI API called on a background thread: -[UIApplication registerForRemoteNotifications] PID: 1303, TID: 27861, Thread name: (none), Queue name: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out, QoS: 0 Backtrace: 4 N-Gal 0x000000010b058211 _T05N_Gal11AppDelegateC29registerForRemoteNotificationyyFySb_s5Error_pSgtcfU_ + 193 5 N-Gal 0x000000010b0574d3 _T0Sbs5Error_pSgIxyx_SbSo7NSErrorCSgIyByy_TR + 115 6 libdispatch.dylib 0x0000000111a4c3f7 _dispatch_call_block_and_release + 12 7 libdispatch.dylib 0x0000000111a4d43c _dispatch_client_callout + 8 8 libdispatch.dylib 0x0000000111a5595b _dispatch_queue_serial_drain + 1162 9 libdispatch.dylib 0x0000000111a562df _dispatch_queue_invoke + 336 10 libdispatch.dylib 0x0000000111a5207d _dispatch_queue_override_invoke + 733 11 libdispatch.dylib 0x0000000111a591f9 _dispatch_root_queue_drain + 772 12 libdispatch.dylib 0x0000000111a58e97 _dispatch_worker_thread3 + 132 13 libsystem_pthread.dylib 0x0000000111f141ca _pthread_wqthread + 1387 14 libsystem_pthread.dylib 0x0000000111f13c4d start_wqthread + 13 Couldn't register: Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator} Couldn't register: Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator} Couldn't register: Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator} 22

谁能帮我隐藏这些日志....?提前致谢!

最佳答案

这不仅仅是一个日志。这是一个警告。 [UIApplication registerForRemoteNotifications] 必须在主线程上调用。您应该将此方法的调用移至 AppDelegatedidFinishLaunchingWithOptions

关于ios - 隐藏不需要的日志打印 - 在 Xcode 9 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46482207/

相关文章:

c++ - Visual Studio 2013 不会忽略禁用的警告

swift - 如何在 iPhone X 中拥有全屏 UITableView(带标题)?

ios - 在 Xcode 中为 native iOS 开发的应用程序

ios - UITableView 和 UICollectionView 在两种不同情况下显示相同的数据

pcap_loop 的最后一个参数中的编译器警告。指向不同大小的整数

php - iOS 接入点 : Creating a Push Notification Queue w/PHP

ios - xcode 中弃用的警告以及如何处理弃用

iOS 11如何将 View 固定到安全区域底部 anchor

ios - 以全分辨率从 UIScrollView 中捕获缩放的 UIImageView

ios - 为 iOS : Native linking failed 编译一个 libGDX 项目