Post

Replies

Boosts

Views

Activity

Reply to Not sure why Swift is giving me a "Cannot find 'xFile' in scope" error
The rule you are breaking is that capitalization matters when you spell a name. You're saying xFile = ... So the Swift compiler looks for the term xFile declared as a variable name in scope, to which something can be assigned. But the word xFile doesn't appear as a variable name in scope — just as the compiler is telling you. What does appear as a variable name in scope is xfile, which as far as Swift is concerned is a totally different name.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22