最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Xcode的Playground中如何复制出错的详细信息

Xcode crifan 2444浏览 0评论

【背景】

Xcode中运行Playground去测试代码:

playground execution terminated because the process stopped unexpectedly

出错了,然后想要复制出错的那一行多出错详细信息。

注:

xcode出错的话,可以在Xcode的错误列表,或者右击错误,Reveal in issue Navigator中,可以右击拷贝出错信息的。

 

【折腾过程】

1.试了邮件,但是右键中没法复制:

right click menu within playground

点击出错所在行的左边的红色同心圆,可以看到:

Reveal in Project Navigation

reveal in project navigator for palyground

但是还是无法复制出错信息。

2.搜:

xcode copy error detail info

参考:

xcode4 – Is there a way to copy/paste error or warning messages from Xcode 4? – Stack Overflow

在Xcode中是可以的。但是此处是在Playground中,没有这个Issue Navigator

【总结】

好像Playground中,没法拷贝出来出错的详细信息->暂时只能查看出错信息。。。

[后记]

折腾:
[已解决]Swift中如何获得一个变量的类型type
期间,
不仅仅更加熟悉和了解了Playground的使用,
还发现了:
对于Playground中的错误信息,是可以复制到其中一部分的。
办法是:
对于底部出状态栏,那个播放键和左边的下拉键,往上拖动,即可显示出底部的调试信息和实时编译出错的信息了:
bottom of playground can show output and error info
比如此处的,拷贝出来的:
copy some content from playground output
对应的错误信息是:
print(toString(library.dynamicType))
      ^~~~~~~~
      String
Swift.toString:1:33: note: 'toString' has been explicitly marked unavailable here
@available(*, unavailable) func toString(x: T) -> String
-》
如此,即使没有完全复制出来,Playground中动态提示的编译的错误和建议的修正的提示,但是也可以拷贝出来,底层错误的详细信息。
然后完全正常的执行后,底部同样会显示出输出信息:
bottom of playground show full output

转载请注明:在路上 » 【已解决】Xcode的Playground中如何复制出错的详细信息

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.200 seconds, using 22.11MB memory