Dee*_*rma 2 pointers dereference swift
在C&中Objective C,我们用于取消引用指针并获取如下值:
C
Objective C
p->a = 1 or int x = p->a
但是我找不到Swift中的等价物.我有一个返回类型UnsafePointer ,AudioStreamBasicDescription?我需要读取其成员值.
UnsafePointer
AudioStreamBasicDescription?
Sve*_*ven 8
您可以使用pointeeUnsafePointer上的属性来访问它指向的内存.所以你的C例子应该是let x = p.pointee.a.
pointee
let x = p.pointee.a
归档时间:
9 年 前
查看次数:
1112 次
最近记录: