I tried to do
var title = [String]()
but an error popped up: Property ‘title’ with type ‘[String]’ cannot override a property with type ‘String?’
How to fix?
have also tried directly
var title = ["a", "b", "c"] and got same error
I tried to do
var title = [String]()
but an error popped up: Property ‘title’ with type ‘[String]’ cannot override a property with type ‘String?’
How to fix?
have also tried directly
var title = ["a", "b", "c"] and got same error
2
Answers
Variable name
title
is reserved asString
it’s a property inside the base classUIViewController
make it another name likeCheck title
its namespace error, you already have property with same name in yore class or yore parent class
for example:
Wrong:
correct: