ios - UILabel appears as "__NSCFString" in crash report (on iPad3 only) -


i'm getting crash reports issue appears happening on model of ipads (the ipad 3). here's error:

nsinvalidargumentexception -[__nscfstring settext]: unrecognized selector sent instance 0x...

and here's section of code it's coming from—specifically, third line below:

for thiscolumn in 0..<numberofcolumns{     let thiselement=elementclass(frame: cgrectmake(0,0,0,0),column:thiscolumn);     thiselement.mylabel.text=elementtext(thiscolumn) 

i don't have ipad 3 test on, , unfortunately "ipad retina" simulator doesn't recreate issue. so, have go on.

elementclass 1 of app's custom classes, , it's subclass of uicontrol. 1 of subviews called mylabel, , should uilabel. because appears __nscfstring in crash, problem may have uilabel setup. elementclass initializer sets uilabel calling following code:

let mylabel=uilabel()  private func setupmylabel(){     let thislabel=mylabel;     thislabel.frame=cgrectmake(0,                                underliney+myimage.frame.size.height,                                self.frame.size.width,                                self.frame.size.height-underliney)     self.addsubview(thislabel)     // other styling     return } 

and once again, has been happening (so far) on ipad 3s. reading, thoughts on problem terrific.

edit:

here's full init method of elementclass:

init(frame: cgrect, column:int) {     // setup general structure     self.column=column;     super.init(frame: frame)     self.frame.size.width=elementwidth;     self.frame.size.height=elementclass.elementheight;     self.backgroundcolor=uicolor.clearcolor()      setupmylabel()      // other setup methods } 


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -