ios - UISearchBar CGContext ERROR -
i have uisearchbar inside view, whenever tap on it, after keyboard comes -
after -(bool)searchbarshouldbeginediting:(uisearchbar *)searchbar
it sends console:
<error>:
cgcontextsetstrokecolorwithcolor
: invalid context0x0
. serious error. application, or library uses, using invalid context , thereby contributing overall degradation of system stability , reliability. notice courtesy: please fix problem. become fatal error in upcoming update.
it repeats same error. wonderring problem?
i believe there null context out there has uisearchbar? tnx.
it´s known issue on apple working on. should fixed in next beta release.
have here: xcode number pad decimal error
edit: have issue textfield maybe should around:
from apple developer forums bye popeye7 - credits him
i have found fix issue! have 3 apps broken on, so, me... find. found solution on stackoverflow... combined 2 answers similar question.
in case, user taps barbuttonitem , "alert" or dialog appears.
i see big difference in how uialertview allocated. "new way" has textfield showing , brings keyboard should.
i able see textfield, enter text , works way expect to. adding "initwithframe" in has no affect on textfield placement.
old way....
- (ibaction)addentrytapped:(id)sender { [_editortextview resignfirstresponder]; [self savetextchanges]; [self dismisspopovers]; _prompt = [[uialertview alloc] initwithtitle:@"new entry title..." message:@"\n\n\n" // important delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"ok", nil]; _textfield = [[uitextfield alloc] initwithframe:cgrectmake(17.0, 55.0, 250.0, 25.0)]; [_textfield setbackgroundcolor:[uicolor whitecolor]]; [_textfield setplaceholder:@"new entry title"]; _textfield.borderstyle = uitextborderstyleroundedrect; _textfield.autocapitalizationtype = uitextautocapitalizationtypewords; _textfield.autocorrectiontype = uitextautocorrectiontypeno; [_prompt addsubview:_textfield]; [_prompt show]; // set cursor , show [_textfield becomefirstresponder]; }
new way...
- (ibaction) addentrytapped:(id)sender { [_editortextview resignfirstresponder]; [self savetextchanges]; [self dismisspopovers]; _prompt = [[uialertview alloc] init]; _prompt.alertviewstyle = uialertviewstyleplaintextinput; uitextfield *text = [_prompt textfieldatindex:0]; _textfield = text; [_prompt setdelegate:self]; [_prompt settitle:@"new entry title..."]; [_prompt setmessage:@""]; [_prompt addbuttonwithtitle:@"cancel"]; [_prompt addbuttonwithtitle:@"ok"]; [_textfield setplaceholder:@"new entry title"]; _textfield.autocapitalizationtype = uitextautocapitalizationtypewords; _textfield.autocorrectiontype = uitextautocorrectiontypeno; [_prompt show]; // set cursor , show keyboard [_textfield becomefirstresponder]; }
message edited popeye7 on 9/25/13 @ 12:25 pm
message edited popeye7 on 9/25/13 @ 12:33 pm
Comments
Post a Comment