objective c - EXC_BAD_ACCESS on UITextView text update -
i have problem, randomly i'm getting weird crash on app, have no idea why.. textfield allocated
[[uitextview alloc] initwithframe:cgrectzero]; could me fix this, or @ least tell me wrong? read on internet trying access pointer gone , app crashes.
the method
- (void)settext:(nsstring*)text textview:(uitextview*)textview{ if (textview != nil) { dispatch_async(dispatch_get_main_queue(), ^{ if ([textview iskindofclass:[uitextview class]]) { textview.text = text; cgsize textviewsize = [textview sizethatfits:cgsizemake(textview.frame.size.width, flt_max)]; textview.frame = cgrectmake(textview.frame.origin.x, textview.frame.origin.y, textview.contentsize.width, textviewsize.height); } }); } }

Comments
Post a Comment