阅读背景:

通过引用传递数组[Swift 3 Xcode 8]

来源:互联网 

I have created a bullet class, and I want it to hold an attribute called locatedInArray. locatedInArray stores a reference of the array that the bullet is stored in within the GameScene class. The only problem is that when I add print statements, it shows that the locatedInArray has different values when compared to the actual array in the game scene. Is there anyway to pass the array by reference instead of value?I have created a bullet class, and I want it to




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: