objective c - Subclassing UIView with IBOutlets -
i've been trying long time add iboutlets uiview. well, seems impossible. created class called "recesscell". file's owner's class "recesscell" , view object's class recesscell. created outlet called "betweenperiods" , seems work. then, tried show custom view in uiscrollview inside uitableviewcell:
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     recesscell *cell = [tableview dequeuereusablecellwithidentifier:@"recess"];     if(cell == nil) cell = (recesscell *)[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"recess"];      uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 1, 320, 50)];     scrollview.showshorizontalscrollindicator = no;     scrollview.bounces = no;     scrollview.pagingenabled = yes;      scrollview.contentsize = cgsizemake(640, 50);     [scrollview addsubview:[[[nsbundle mainbundle] loadnibnamed:@"recesscell" owner:self options:nil] objectatindex:0]];     [cell addsubview:scrollview];     return (uitableviewcell *)cell; } of course, didn't work. every time load xib annoying run-time error, again , again makes me want kill myself :
'[ setvalue:forundefinedkey:]: class not key value coding-compliant key betweenperiods.' while setuprecess uiviewcontroller class. setuprecess shouldn't have outlet betweenperiods - recesscell should.
that's why tried change owner in loadnib method cell. well, guess what? didnt work.
'[ setvalue:forundefinedkey:]: class not key value coding-compliant key betweenperiods.'
i'm totally frustrated, can see. have no idea what's problem, , not how fix it.
please help, thank you.
    - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath     {          recesscell *cell = [tableview dequeuereusablecellwithidentifier:@"recess"];          if(cell == nil) {                   nsarray *nib=[[nsbundle mainbundle] loadnibnamed:@"recesscell" owner:self options:nil];                  cell=[nib objectatindex:0];                  cell.showsreordercontrol=no;                  cell.selectionstyle=uitableviewcellselectionstylenone;                  cell.backgroundcolor=[uicolor clearcolor];              }               uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 1, 320, 50)];              scrollview.showshorizontalscrollindicator = no;              scrollview.bounces = no;              scrollview.pagingenabled = yes;               scrollview.contentsize = cgsizemake(640, 50);              [scrollview addsubview:[[[nsbundle mainbundle] loadnibnamed:@"recesscell" owner:self options:nil] objectatindex:0]];              [cell addsubview:scrollview];               return cell;          } 
Comments
Post a Comment