uitextfield - UISearchBar Custom InputView Crash in iOS8 -
i have uisearchbar
custom inputview. can't set custom inputview uisearchbar in ios8
. it's crashing.
here how set custom inputview uisearchbar
for(int =0; i<[[[self.sbar.subviews objectatindex:0] subviews] count]; i++) { if([[[[self.sbar.subviews objectatindex:0] subviews] objectatindex:i] iskindofclass:[uitextfield class]]) { [[[(uitextfield*)[sbar.subviews objectatindex:0] subviews] objectatindex:i] setfont:[uifont fontwithname:@"customfont" size:15]]; uitextfield* search=[[(uitextfield*)[sbar.subviews objectatindex:0]subviews] objectatindex:i]; search.delegate = self; [[[(uitextfield*)[self.sbar.subviews objectatindex:0] subviews] objectatindex:i] setinputview:mykeyboard]; }
here crash log.
could not load "" image referenced nib in bundle identifier "com.company.myapp" 2014-09-23 13:34:13.816 myapp[1651:61729] not load "" image referenced nib in bundle identifier "com.company.myapp"
it's working fine in ios 7 crash in ios8.
how can fix it?
i got answers own question.
but need check ios version first ios8
because code doesn't work ios7
.
if([systemversion isequaltostring:@"8"]) { uitextfield *search = (uitextfield *)[[[self.sbar.subviews objectatindex:0] subviews] objectatindex:0]; [search setfont:[uifont fontwithname:@"mycustomfont" size:15]]; [search setinputview:self.customkeyboard]; [search settextcolor:[uicolor whitecolor]]; [self.customkeyboard settextview:search]; [search reloadinputviews]; }
Comments
Post a Comment