ios - Use of unresolved identifier '_ComboItemId' -


hello friends getting strange error while creating model class though have created class shows error
suggestion !!
thank

here code

import foundation class combomodel { private var _comboitemid: string! private var _combomaincategory: string! private var _combocategoryid: string! }  var comboitemid : string { return _comboitemid // error use of unresolved identifier '_comboitemid' }  init(comboitemid : string) {  self._comboitemid = comboitemid // error initializers may declared within type } 

this simple user mistake. you've got class private variables

class combomodel {     private var _comboitemid: string!     private var _combomaincategory: string!     private var _combocategoryid: string! } // class ends here!!! 

now you're trying access combomodel classes private variable _comboitemid.

var comboitemid : string {     return _comboitemid // error use of unresolved identifier '_comboitemid' } 

so, you're looking for:

class combomodel {     private var _comboitemid: string!     private var _combomaincategory: string!     private var _combocategoryid: string!      var comboitemid : string {         return _comboitemid     }      init(comboitemid : string) {         self._comboitemid = comboitemid     }  } 

Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -