UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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

Forums > Swift

@AE542  

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.

3      

hi,

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.

DMG

3      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.