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
Post a Comment