Iphone switching windows and restoring tableviewclicks

Now that we’ve finally found the time to post some of our code to the ffmpeg4iphone project that we have been contrbuting to, it makes it a lot easier to illustrate techniques.

Here is our common.m and common.h files.

The two methods to look at here are

Switch windows which switch between and iphone uiwindow and an sdl full screen window and iphonepump messages which run a cfrunloop to restore tableview click functionality lost after returning from the sdl function.


void iPhonePumpMessages()

//printf(“runloop return %u\n”,CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE));
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, TRUE);

void switchWindows() {

     SDLUIKitDelegate *appDelegate = [SDLUIKitDelegate sharedAppDelegate]; 
     NSLog(@"switch windows"); 
 [appDelegate switchTopWindow]; 


And the appdelegate looks like this


-(void) switchTopWindow {
NSLog(@“making uiwindw key window”);
[myWindow makeKeyAndVisible];