I have a class, Tags, in Swift.
public class Tags {
var lastUsed: UInt64
var frequency: Int
var id: String
var name: String
init(id: String = "", frequency: Int, lastUsed: UInt64, name: String) {
self.id = id
self.frequency = frequency
self.lastUsed = lastUsed
self.name = name
}
}
I can access the fields from some classes in my project, but funny enough I cant seem to access some of the fields from some classes.
The offending fields are lastUsed and name.
When I run Find Selected Symbol in Workspace , I discovered that the fields are visible from some files where they are referenced and are not visible from other files.
I can actually access the other fields of the class Tags in the class.
The class I cannot access it from has the following definition:
import RealmSwift
class StoredTags: Object{
@objc dynamic var frequency: Int
@objc dynamic var id: String
@objc dynamic var lastUsed: UInt64
@objc dynamic var name: String
init(freq: Int, id: String, lastUsed: UInt64, name: String){
self.lastUsed = lastUsed
self.name = name
self.frequency = freq
self.id = id
}
init(t: Tags){
self.lastUsed = t.lastUsed. //Error-- Value of type 'Tags' has no member 'lastUsed'
self.name = t.name
self.frequency = t.frequency
self.id = t.id
}
class func getFromTags(t: Tags) -> StoredTags{
let st = StoredTags()
st.frequency = t.frequency
st.id = t.id
st.lastUsed = t.lastUsed//Error-- Value of type 'Tags' has no member 'lastUsed'
st.name = t.name//Error-- Value of type 'Tags' has no member 'name'
return st
}
required override init() {
self.frequency = 0
self.id = ""
self.lastUsed = 0
self.name = ""
}
}
I suspect it might be some issue with xcode; but I have tried all that comes to mind.
What could be the issue here, please?
