contextData与context.fetch和fetchRequest.execute之间的区别

时间:2017-07-08 10:24:32

标签: swift core-data

我的目标是iOS 10,无法决定我应该选择哪种方法以及为什么?由于以下两个代码都返回了对象数组。

  override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {

    let touch: UITouch = touches.first!
    let location: CGPoint = touch.location(in: self)
    let node: SKNode = self.atPoint(location)
    let duration = 0.25

    if node == selectButton {

        setNewPlayerSprite(nameOfPlayer: (centerPlayer?.name)!)

    } else if node == lockedButton || node == priceLabel {

        unlockPlayer(nameOfPlayer: (centerPlayer?.name)!)

    } else if node == otherButton {

        getSpecialUnlockData()

    } else if node == purchaseButton || node == purchasePriceLabe {

        purchaseCharacter(ID: characterProductID)

    } else if node == buyButton {

        giveItemAmount(itemName: "Item2", giveAmount: 1)

    }

0 个答案:

没有答案