Simple UITextView crash

I am trying to use a simple one UITextViewin a basic view, but this leads to an accidental application crash. Sometimes it crashes when I type something in it, sometimes when I scroll, sometimes after I press the return key. From the stack trace, it looks like it is called by a graphic or animation code to visualize user interface elements for spelling, grammar checking, etc.

Why is this crashing my application? Do I need to import additional libraries or do I need to specify some kind of delegate for UITextView? I literally just have a simple UITextView in barebones mode, nothing out of the ordinary.

Here's the stack trace:

Program received signal:  "EXC_BAD_ACCESS".
(gdb) bt
#0  0x9535f9b1 in ?? ()
#1  0x9534c33f in ?? ()
#2  0x9534c13e in ?? ()
#3  0x9634df5c in ?? ()
#4  0x9418d244 in CGDataProviderRetain ()
#5  0x963b7036 in ?? ()
#6  0x98263486 in CGImageReadCreateWithProvider ()
#7  0x982633a2 in CGImageSourceCreateWithDataProvider ()
#8  0x020c0947 in CGImageCreateWithPNGDataProvider ()
#9  0x02ebfeed in WKGraphicsCreateImageFromBundleWithName ()
#10 0x02ebfc3b in WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar ()
#11 0x02ebf9cb in WebCore::InlineTextBox::paintSpellingOrGrammarMarker ()
#12 0x02e73932 in WebCore::InlineTextBox::paintDocumentMarkers ()
#13 0x02e730a1 in WebCore::InlineTextBox::paint ()
#14 0x02e717ef in WebCore::InlineFlowBox::paint ()
#15 0x02e71565 in WebCore::RootInlineBox::paint ()
#16 0x02e71220 in WebCore::RenderLineBoxList::paint ()
#17 0x0354c451 in WebCore::RenderBlock::paintContents ()
#18 0x02e6d7bd in WebCore::RenderBlock::paintObject ()
#19 0x02e6ed51 in WebCore::RenderBlock::paint ()
#20 0x02e6dcf2 in WebCore::RenderBlock::paintChildren ()
#21 0x02e6d7bd in WebCore::RenderBlock::paintObject ()
#22 0x02e6ed51 in WebCore::RenderBlock::paint ()
#23 0x02e6c502 in WebCore::RenderLayer::paintLayer ()
#24 0x02e6bce3 in WebCore::RenderLayer::paintLayer ()
#25 0x02e6b635 in WebCore::RenderLayer::paint ()
#26 0x02e6b3de in WebCore::FrameView::paintContents ()
#27 0x03bd71da in -[WebFrame(WebInternal) _drawRect:contentsOnly:] ()
#28 0x03bd7104 in -[WebHTMLView drawSingleRect:] ()
#29 0x02e6af68 in _WKViewDraw ()
#30 0x02e6b03f in _WKViewDraw ()
#31 0x02e6b03f in _WKViewDraw ()
#32 0x02e6b03f in _WKViewDraw ()
#33 0x02e6b03f in _WKViewDraw ()
#34 0x02e6adb0 in WKViewDisplayRect ()
#35 0x02e6ad41 in WKWindowDrawRect ()
#36 0x02e6a9d3 in WebCore::TileCache::drawLayer ()
#37 0x04041d63 in backing_callback ()
#38 0x0404161e in CABackingStoreUpdate ()
#39 0x040407f4 in -[CALayer _display] ()
#40 0x02e6a3d4 in -[TileLayer display] ()
#41 0x040402b1 in CALayerDisplayIfNeeded ()
#42 0x0403f65b in CA::Context::commit_transaction ()
#43 0x0403f2b0 in CA::Transaction::commit ()
#44 0x04046f5b in CA::Transaction::observer_callback ()
#45 0x02391d1b in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#46 0x02326987 in __CFRunLoopDoObservers ()
#47 0x022efc17 in __CFRunLoopRun ()
#48 0x022ef280 in CFRunLoopRunSpecific ()
#49 0x022ef1a1 in CFRunLoopRunInMode ()
#50 0x02c152c8 in GSEventRunModal ()
#51 0x02c1538d in GSEventRun ()
#52 0x002e2b58 in UIApplicationMain ()

EDIT: , , . "" " " " " ( , autocorrectionType UITextInputTraits) "", . , .

, , , iOS 4.1 SDK, , , UITextView SDK .

2: , . modal view UITextViews, . , - , , . barebone, . :

- (IBAction)showFeedback:(id)sender {
    FooViewController *controller = [[FooViewController alloc] initWithNibName:@"FooView" bundle:nil];
    [self presentModalViewController:controller animated:YES];
    [controller release];
}

FooViewController - , Xcode, UIViewController. . nib UITextView. .

, .

NSZombieEnabled, , .

- 5 . 5 . . , .

, , , ( ), ? -, , , UITextView, Interface Builder. , .

!!!

+5
3

EXC_BAD_ACCESS , . , , . , .

EDIT: , , .

+2

. , , .

+1

I had this problem - I stupidly set my TextView instead of the text color! So I had this:

self.myTextView = [UIColor lightGrayColor];

instead of this:

self.myTextView.textColor = [UIColor lightGrayColor];
0
source

All Articles