NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

Complete Beginner Question about 'Cannot call value of non function type Int' Error

Forums > Swift


Hey guys first time poster and beginner learner. I just wanted to ask a question for anyone using hacking with ios uikit edition for those that use it. Is it bad to write out the all the code in the book into one playground? Because the error; 'Cannot call value of non function type Int' came up when I was creating an array;

“var songs = ["Shake it Off", "You Belong with Me", "Back to December"] type(of: songs)” It didn't print Array<String> Type into the results pane either. But when I copied it to a new playground the error disspeared and it showed in the results pane. When putting in the type section the came up.

Sorry if it seems a little vague but I'll give more info if asked.

Thanks in advance.



you mentioned:

Sorry if it seems a little vague but I'll give more info if asked.

it does seem a little vague, so please consider yourself asked. What specific code returns the error message of your thread's title? maybe then we can move to the "It didn't print ... either" question

looking forward (i think!) to what you can provide.



Hacking with Swift is sponsored by Paw

SPONSORED Use Paw to build, test and describe web APIs. Paw has a lightning fast native macOS interface to compose requests, collaborate in real-time on API specs, and generate client code for your applications. You can import and export API definitions.

Discover Paw for Mac

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

Not logged in

Log in

Link copied to your pasteboard.