Note that there are some explanatory texts on larger screens.

plurals
  1. POCrash after assign UIImage to UIImageView.image
    primarykey
    data
    text
    <p>In my code:</p> <p>*.h file</p> <pre><code>UIImageView* imgFACE; UIImage* imgF; UIImage* imgG; </code></pre> <p>initialization:</p> <pre><code>imgF = [UIImage imageNamed: @"f.png"]; imgG = [UIImage imageNamed: @"g.png"]; UIImageView *img; img = [[UIImageView alloc]initWithFrame:FACE_RECT]; [self addSubview:img]; self.imgFACE = img; [img release]; </code></pre> <p>in drawRect, frequently:</p> <pre><code>NSLog(@"[%@]", imgF); if(something) self.imgFACE.image = imgF; else self.imgFACE.image = imgG; </code></pre> <p>standard result of NSLog is:</p> <pre><code>[&lt;UIImage: 0x5db6b0&gt;] </code></pre> <p>sometimes this simply code generate crash, result of NSLog is strange:</p> <pre><code>[Length 4 (2 blocks, 1 used, block 0 is at 0) 4 0x146d22c0 { NSColor = "UIDeviceWhiteColorSpace 0 1"; NSFont = "&lt;UICTFont: 0x1454fc00&gt; font-family: \".HelveticaNeueInterface-M3\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; NSParagraphStyle = "Alignment 0, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 4, Tabs (\n 28L,\n 56L, \n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (null), Lists (null), BaseWritingDirection -1, HyphenationFactor 0, TighteningFactor 0, HeaderLevel 0"; NSShadow = "NSShadow {0, -1} color = {(null)}"; } </code></pre> <p>What's a kind of object?</p> <p>CRASH LOG:</p> <pre><code>0libobjc.A.dylib 0x3b393b26 objc_msgSend + 5 1NOM2 0x000ad7a5 -[PanelInfoView myTimerMethod] (PanelInfoView.m:527) + 309157 2Foundation 0x319a3ecd __NSFireTimer + 64 3CoreFoundation 0x30f8b0e7 &lt;redacted&gt; + 14 4CoreFoundation 0x30f8acff &lt;redacted&gt; + 782 5CoreFoundation 0x30f8909b &lt;redacted&gt; + 1210 6CoreFoundation 0x30ef3ce7 CFRunLoopRunSpecific + 522 7CoreFoundation 0x30ef3acb CFRunLoopRunInMode + 106 8GraphicsServices 0x35c14283 GSEventRunModal + 138 9UIKit 0x33795a41 UIApplicationMain + 1136 10NOM2 0x0006e44d main (main.m:25) + 50253 </code></pre> <p>As I think it's result of the memory leak. imgF &amp; imgG are initialized only once.</p> <p>What's happen with this UIImage?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload