xcode4.3 - strange behaviour Xcode -


in view controller have method -(void) showdescription: (id) description witch two things:

  1. displays description in label
  2. and runs method in view gives setneedsdisplay view.

now here strange thing:

if call showdescription method in code, goes showdescription (i have nslog), reads description ok ( nslog) doesn't change label or run view method setneedsdisplay (no nslog).

but... if call same method button works fine: puts label.text , redraws view.

i realised same behaviour when put 2 breakpoints 1 in showdescription , 1 in view method. in first case doesn't go view method, in second (uiaction) does.

how strange that? have clue why? because i'm lost....

thanks lot

clemcore

classes:

  • graphviewcontroller: uiviewcontroller
  • graphview: uiview

**graphviewcontroller.m*******

 -(void) showdescription: (id) description { nsstring* text= [(nsstring*) description copy]; self.labledescription.text=text; //display description in label [self.graphview redrawview]; } -(void)displaygraph { nslog(@"graphviewcontroller.displaygraph"); nslog(@"self.programdata %@",self.programdata); //these work fine nslog(@"description lable %@",self.programdescriptiondata); [self showdescription:self.programdescriptiondata]; [self.graphview redrawview]; } - (ibaction)redraw { nslog(@"ibaction redraw"); nslog(@"mydata %@",self.graphview.mydata); [self showdescription:@"cccc"]; [self.graphview redrawview]; } 

graphview.m***

-(void)redrawview //public method { nslog(@"redrawview"); [self setneedsdisplay]; } 

i using xcode 4.3.3 on lion 10.7.4

here happens:

if call displaygraph, programdata , programdescriptiondata fine.(nslog displays correctly) but… doesn't change label , doesn't go redrawview (no nslog redrawview).

here log: 2012-07-08 12:29:19.193 calculatorgraph[2641:f803] graphviewcontroller.displaygraph 2012-07-08 12:29:19.194 calculatorgraph[2641:f803] self.programdata ( 22 ) 2012-07-08 12:29:19.194 calculatorgraph[2641:f803] description lable 22 2012-07-08 12:29:19.195 calculatorgraph[2641:f803] text 22 

now, if push button seems work: updates label , redraws view , drawrect in view. see problem?

 2012-07-08 14:16:54.358 calculatorgraph[2743:f803] ibaction redraw 2012-07-08 14:16:54.358 calculatorgraph[2743:f803] mydata <graphviewcontroller: 0x6d3f1f0> 2012-07-08 14:16:54.359 calculatorgraph[2743:f803] text cccc 2012-07-08 14:16:54.359 calculatorgraph[2743:f803] redrawview 2012-07-08 14:16:54.360 calculatorgraph[2743:f803] redrawview 2012-07-08 14:16:54.362 calculatorgraph[2743:f803] graphview.drawrect 2012-07-08 14:16:54.363 calculatorgraph[2743:f803] data in graphview drawrect is: <graphviewcontroller: 0x6d3f1f0> 

screenshot of storyboard: please see link lower in comments...

thank you

are sure iboutlet labledescription? might labeldescription? plus: should never "[self.graphview redrawview];"; should "[self.graphview setneedsdisplay:yes]" instead. "showdescription" appropriate method name? (do have "hidedescription" method?).


Comments