什么是“&错误"?在Objective-C中意味着什么? [英] What does "&error" mean in Objective-C?

查看:124
本文介绍了什么是“&错误"?在Objective-C中意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
为什么在此处使用错误:&错误"(目标-c)

Possible Duplicate:
why is "error:&error" used here (objective-c)

AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device
                                                                    error:&error];

上述代码中的&符号是什么意思?

What does the & symbol mean in the above code?

推荐答案

它是运算符的地址;它产生一个指向引用对象的指针.在这种情况下,errorNSError *AVCaptureDeviceInput deviceInputWithDevice:error:带有一个地址,并可以通过该指针修改error来指示发生的错误.

It's the address-of operator; it produces a pointer pointing to the referent. In this case, error is an NSError *; AVCaptureDeviceInput deviceInputWithDevice:error: takes an address to it and may modify error through that pointer to indicate the error that occurred.

这篇关于什么是“&错误"?在Objective-C中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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