ios - 如何在 iOS 的 Nativescript 中调用 NSLog

标签 ios objective-c swift debugging nativescript

Programming Nativescript on a laptop with a terminal only 100x wide looks like this:

https://s3.postimg.org/arqwz0utv/Screen_Shot_2016_08_16_at_11_29_39_PM.png

我不了解你,但我什至看不到我从我的应用程序中记录的内容......

这是我要创建的 console.log 模块的计划:

  • 基于loginfowarnerror 的颜色,带有帮助色盲(我)的选项
  • 可根据每个用户的喜好定制选项
  • 整理终端以真正理解从应用程序记录的内容

到目前为止我尝试了什么:

  • tns-core-module console - 尝试了很多不同的东西;根本搞不懂iOS是怎么登录终端的
  • tns-core-module trace - 尝试调用 trace.write 但不成功
  • 尝试 Swift 的 printprintln

In my attempt to create a cleaner console.log, how do I call NSLog inside my Nativescript app?

我在 Android 上调用 android.util.Log.v 没问题,所以这部分都准备好了。

最佳答案

您无法在 iOS 运行时访问 Variadic Objective-C 方法。 这是限制列表

限制 无法从 JavaScript 访问以下成员:

  • 工会
  • 可变参数 Objective-C 方法、函数指针、 block
  • 具有常量数组成员的结构
  • 载体
  • 内联函数
  • int64_t, uint64_t 在 [-2^53, 2^53] 范围之外
  • long double, int128_t, uint128_t

文档部分的链接:http://docs.nativescript.org/runtimes/ios/Limitations.html

关于ios - 如何在 iOS 的 Nativescript 中调用 NSLog,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38987768/

相关文章:

ios - 针对特定情况优化 iOS 应用程序

ios - 如何在 Swift 中显示框架(SDK)中的 View Controller ?

iphone - Obj-C,在 View 中带有警报 View /进度指示的线程安全进程,可以从 applicationWillEnterForeground <= iOS4? 调用

swift - 使用 firebase 连接到 Tableview 的搜索栏

swift - 按条件对 NSMutableArray 进行排序

ios - Apple 会拒绝使用 Apple 应用程序中使用的图像的应用程序吗?

ios - 在表格 View 中添加动态图片

Objective-c 类方法和复制返回值

objective-c - 在 NSTextField 内绘制固定符号

ios - 如何等待 AppDelegate 中的事件完成(Swift)