ios - Thread issue where updating a label make a UIImageview invisible -


i have situation confusing me lots. have class has 2 separate things: animated uiimage , uilabel. have different outlets, not connected.

when app runs, this:

dispatch_async(dispatch_get_main_queue(), ^{     [self.monstermachine sethidden:no]; //monstermachine uiimageview     [self.monstermachine startanimating]; }); 

but when this:

    [self.futtext settext:@"blah"]; // uilabel 

it causes monstermachine uiimageview not animate anymore. things have found:

right after settext:@blah" can use nslog watch , see self.monstermachine.isanimated goes 1 0, ie yes no.

if self.futtext saying "blah", can run settext:@"blah" on many times want , nothing happens, when change value other blah uiimageview stops animating , disappears

if don't use main_queue show , animate monstermachine, won't display @ all, how diagnose or fix this?

that's weird works me perfect. did call [self.futtext settext:@"blah"]; in main queue also? here small answer why setting text @"blah" won't stops animation: strings @"blah" stored in stacks have same reference long have same context. in case [self.futtext settext:@"blah"] nothing because internal implementions like:

void settext:(nsstring*) text {   if ( _text == text ) return;//if reference same nothing   _text = text;   rendering.. } 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -