Reputation: 501
I've created a UIView, and I'm showing it as modal dialog by using CFRunLoopRun.
Everything works fine, but when the user does any kind of scrolling in the UIView, it exits the CFRunLoopRun.
I've read about this issue but didn't find a solution.
Any idea?
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
[customdialog show]; // my method to show the dialog
CFRunLoopRun(); //exits CFRunLoopRun when scrolling on customdialog (UIView)
[pool release];
Upvotes: 0
Views: 284
Reputation: 299345
Scrolling causes the runloop mode to change, and this is probably causing CFRunLoopRun()
to terminate. So you'd need to keep re-running CFRunLoopRun()
repeatedly until you set some flag to stop.
But there's seldom any reason to do this. You can subclass UIAlertView
, or you can simply make your dialog full-screen so that it prevents touches on the other view (that's how I always do this). Just create a transparent, full-screen view, and put your dialog in it, and add it as a subview of the current view. Then there's no special futzing with the runloop.
Upvotes: 2