views:

23

answers:

0

i'm having issues where if I use draw commands in a UIView::drawRect method, components created through Interface Builder will not resolve their events. Is there a way to force events to resolve, kind of like how you can force a draw by calling [self setneedsdisplay].

yes, i'm having problems clicking on buttons and switches. the events created when touching a component don't get resolved until the application attempts to exit.

this is my draw function:

-(void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextClearRect(context, rect);
    CGContextDrawImage(context, rect, image);
}

After some debugging, i found out that i need to lower my NSTimer to update @ 10 FPS or less for the events to get handled. Unfortunately, this is not a good solution as it also slows down my game.