Learn iOS SpriteKit with Examples, Code Snippets and Video Tutorials

Troubleshooting Arrays in a Property List with Swift

Troubleshooting Arrays in a Property List with Swift
October 20, 2014 Justin
Getting Array Data from a Property List with Swift

I had the worst time recently trying to convert AnyObject to a Swift Array when parsing a property list. You can see the property list above I was trying to bring in.


I tried a lot of variations and got a lot of errors. Like…

  • Argument for generic parameter ‘T’ could not be inferred
  • Cannot convert the expressions’s type ‘AnyObject?’ to type ‘Array<T>’

So hopefully if you stumbled onto this post with one of those, I’m proud to say I eventually just went with an NSArray.

Worked fine from there on!


Justin Dike is the owner and lead developer at CartoonSmart.com. He's taught hundreds of hours of game development video tutorials, covering everything from coding to art. These days he's working mostly on Swift and Sprite Kit tutorials, which often lead into highly polished iOS / tvOS Starter Kits, which require no programming at all, but are capable of making nearly any type game! Yeah, you read that write. You can also find Justin at the official CartoonSmart Podcast


Leave a reply

Check out our premium Swift and Sprite Kit Tutorial content!

Visit CartoonSmart.com