Please fix this mistake!

Discussion in 'iOS Programming' started by AlexTheXcodeProgrammer, Nov 21, 2015.

  1. AlexTheXcodeProgrammer macrumors newbie

    Joined:
    Oct 11, 2015
    #1
    Hello everybody, I don't know how to fix this issue which prevents me from running my game. Thank you for your time and consideration. Screen Shot 2015-11-21 at 19.58.28.png
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    I'm going to say you need to change SKSpriteNode to NSObject in the signature.

    Then in the first line of the block you'll need a line casting child from an NSObject to an SKSpriteNode.

    Yay type safety, right? This definitely keeps you from making mistakes and in no way wastes your time or makes the code harder to read.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Trying using "id obj" instead of "SKSpriteNode * child" in your enumerateObjectsUsingBlock call. Does that fix it?
     

Share This Page