objective c - __NSStackBlock__ isEqualToString: issue -
i experimenting this code. in 1 of viewcontroller
's using next snippet:
- (bool)textview:(uitextview *)textview1 shouldchangetextinrange:(nsrange)range replacementtext:(nsstring *)text { if([text isequaltostring:@"\n"]) { [textview resignfirstresponder]; return no; } return yes; }
i found in web dismissing keyboard pressing returnbutton
. works when calling viewcontroller
. in root klnoteviewcontroller
adding notification in handle state changes-method:
- (void) setstate:(klcontrollercardstate)state animated:(bool) animated { [[nsnotificationcenter defaultcenter] postnotificationname:@"refresh" object:self]; if (animated) { [uiview animatewithduration:self.noteviewcontroller.cardanimationduration animations:^{ [self setstate:state animated:no]; }]; return; } //full screen state if (state == klcontrollercardstatefullscreen) { [self expandcardtofullsize: animated]; [self setycoordinate: 0]; } //default state else if (state == klcontrollercardstatedefault) { [self shrinkcardtoscaledsize: animated]; [self setycoordinate: originy]; } //hidden state - bottom else if (state == klcontrollercardstatehiddenbottom) { //move off screen , far enough down shadow not appear on screen [self setycoordinate: self.noteviewcontroller.view.frame.size.height + abs(self.noteviewcontroller.cardshadowoffset.height)*3]; } //hidden state - top else if (state == klcontrollercardstatehiddentop) { [self setycoordinate: 0]; } //notify delegate of state change (even if state changed self) klcontrollercardstate laststate = self.state; //update new state [self setstate:state]; //notify delegate if ([self.delegate respondstoselector:@selector(controllercard:didchangetodisplaystate:fromdisplaystate:)]) { [self.delegate controllercard:self didchangetodisplaystate:state fromdisplaystate: laststate]; } }
and add adding observer:
[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(dismisskeyboard) name:@"refresh" object:nil];
in every viewcontroller
s -viewdidload
. when observer used uitextfield
works fine, in viewcontroller
when using uitext view
have crash log:
[nsstackblock isequaltostring:]: unrecognized selector sent instance 0xbfffd228
i searched in web found 2 links explanation of nsstackblock
, not informative me solve problem. can explain can be?
Comments
Post a Comment