我想在NSPointerArray中存储弱引用,但出现错误:publicvarobjectWithReloadFRC=NSPointerArray(options:NSPointerFunctionsWeakMemory)objectWithReloadFRC.addPointer(self)//selfisanUIViewControllersubclass也试过这个:objectWithReloadFRC.addPointer(UnsafePointer(self) 最佳答案 您可以获得指向用于对象的存储的指针unsafeAdd