ios - calling function from a different class - Throws error 'class has no member the function' -


i have below class declared in separate swift file

class keerthanaiarray: nsobject {     var songtitle: string = string()     var songlyrics: string = string()     var esongtitle: string = string()      init(songtitle: string, songlyrics:string, esongtitle: string) {         self.songtitle = songtitle         self.songlyrics = songlyrics         self.esongtitle = esongtitle     }      func match(string:string) -> bool {         return songtitle.containsstring(string) || esongtitle.containsstring(string)     } } 

but when reference class in masterviewcontroller throws error message saying value of type [keerthanaiarray] has no member 'match'

below code..the code fails in searchr statement

      var keerthanaiarray = [keerthanaiarray]()   override func viewdidload() {     super.viewdidload()      **let searchr = (keerthanaiarray.match(keerthanaiarray.songtitle.lowercasestring))** 

var keerthanaiarray = [keerthanaiarray]() 

this instantiating array of keerthanaiarray. think you're trying this:

var keerthanaiarray = keerthanaiarray(songtitle: "some", songlyrics: "text", esongtitle: "here") 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -