Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UIImage of UIImageView fail #14

Open
mrvandai opened this issue Jun 29, 2015 · 5 comments
Open

Update UIImage of UIImageView fail #14

mrvandai opened this issue Jun 29, 2015 · 5 comments

Comments

@mrvandai
Copy link

Running OK:

  • (void)mainThreadTimerDidFire:(MSWeakTimer *)timer {
    NSAssert([NSThread isMainThread], @"This should be called from the main thread");
    int ak = [self.label.text integerValue];
    if(ak>255)
    ak= 0;
    self.label.text = [NSString stringWithFormat:@"%d", ak + 1];
    int kaaaa = floor(ak%80);
    UI *k = [oldMatrix objectAtIndex:kaaaa];
    k.backgroundColor = [UIColor colorWithRed:ak%255/255 green:ak%255/255 blue:ak%255/255 alpha:ak/255.0f];
    }

UIImageView not change image:

  • (void)mainThreadTimerDidFire:(MSWeakTimer *)timer {
    NSAssert([NSThread isMainThread], @"This should be called from the main thread");
    int ak = [self.label.text integerValue];
    if(ak>20)
    ak= 0;
    self.label.text = [NSString stringWithFormat:@"%d", ak + 1];
    UI *k = [oldMatrix objectAtIndex:kaaaa];
    UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"balls-0-%d", kaaaa]];
    k.image = image;
    }

Note: oldMatrix: array of UIImageView

@JaviSoto
Copy link
Contributor

Would you mind sharing a little bit more of code? How is the timer being created? Thanks!

@mrvandai
Copy link
Author

@JaviSoto
Copy link
Contributor

Mind pasting the code here? I'd rather not download a zip file from a sketchy website.

@mrvandai
Copy link
Author

mrvandai commented Jul 3, 2015

JaviSoto, you can see here: https://github.com/mrvandai/MSWeakTimerError

Thank you!

@mrvandai
Copy link
Author

Any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants