为什么 Xcode 6 将动态链接编辑器库中的自动补全设为真? [英] Why does Xcode 6 keep autocompleting true as TRUE from the Dynamic Link Editor library?

查看:20
本文介绍了为什么 Xcode 6 将动态链接编辑器库中的自动补全设为真?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍在学习 Swift 和 iOS 开发,但我遇到了这个问题,尽管我尝试深入研究,但我仍然有点困惑.

I'm still learning Swift and iOS development but I've been running into this issue and despite my attempts to dig into the weeds a bit I'm still a little confused.

当我开始输入 true 时,Xcode 6 建议自动补全 TRUE.不是世界末日.然而,有一次我决定看看如果我使用 TRUE 会发生什么,结果给了我一个错误:

When I start typing true Xcode 6 suggests the autocompletion TRUE. Not the end of the world. However, one time I decided to see what would happen if I used TRUE and the result gave me an error:

'DYLD_BOOL' 不能转换为 'Bool'

好的,所以 TRUE 不是 Bool...我查看了定义 DYLD_BOOL 的文件(顺便说一下,它是一个结构体)并找到以下代码:

Ok, so TRUE is not a Bool... I looked at the file where DYLD_BOOL is defined (it's a struct, by the way) and found the following code:

struct DYLD_BOOL {初始化(_ 值:UInt32)变量值:UInt32}var FALSE: DYLD_BOOL { 获取 }var TRUE: DYLD_BOOL { get }

现在我彻底糊涂了;我不明白这段代码在做什么.有人可以解释一下这里发生了什么吗?什么是 DYLD_BOOL,我什么时候使用它?

Now I'm thoroughly confused; I don't understand what this code is doing. Can someone please shed some light on what is going on here? What is a DYLD_BOOL and when would I use it?

提前致谢.

推荐答案

1) 您没有做错任何事情,我遇到了与自动完成相同的问题:当您尝试键入true"时,Xcode 尝试将其自动完成为真"而不是真".

1) you're doing nothing wrong, I experience the same issue with autocompletion : when you try to type 'true', Xcode tries to autocomplete this as 'TRUE' instead of 'true'.

我刚刚将此作为错误提交,报告编号为18945902"

I just filed this as a bug, report number '18945902'

有时您需要通过在其他地方输入true"并复制/粘贴文本来解决此问题.这是一个愚蠢的 Xcode 错误.

Sometimes you need to solve this by typing 'true' somewhere else, and copy/pasting the text. This is a stupid Xcode bug.

2) 'DYLD' 的东西是一些 'DYnamic Loader' 库,它定义了它自己的 'Bool' 类型,值为 'TRUE' 和 'FALSE'.这样做通常是出于与来自其他平台或库的代码兼容的原因.

2) the 'DYLD' stuff is some 'DYnamic LoaDer' library, which defines it's own 'Bool' type, with values 'TRUE' and 'FALSE'. This is often done for code compatibility reasons with code coming from other platforms or libraries.

你真的可以忘记它,对布尔值使用真"和假",它应该在下一个 XCode 版本中修复,因为它是一个恼人的错误.

You can really just forget about it, and use 'true' and 'false' for booleans, it should be fixed in the next XCode release as it's an annoying bug.

如果你真的想了解更多关于 DYLD 的信息,这里是 DYLD 的文档 :-)

If you really want to know more about DYLD, here's the doc of the DYLD :-)

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html

这篇关于为什么 Xcode 6 将动态链接编辑器库中的自动补全设为真?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆