> On Nov 5, 2015, at 2:37 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote: > > iOS 9.1, iPhone 5S, ObjC > > I'm getting the following runtime warning due to multiple simultaneous > UIAlertControllers presenting at the same time: > > Warning: Attempt to present <UIAlertController: 0x1835c000> on > <MyViewController: 0x17d26e70> which is already presenting > <UIAlertController: 0x18381400> > > I know only one alert view controller can be presenting at a time, so the way > I thought to serialize execution of each -presentViewController:: is: > > dispatch_async( dispatch_get_main_queue(), ^{ > [ self presentViewController: alert > animated: YES > completion: nil ]; > }); > > Why isn't dispatch_get_main_queue() enforcing serialized execution?
It does enforce serialized execution, but that doesn’t help if what you are asking for is effectively asynchronous as well (you just get your requests issued in a serialized fashion). > Is there another way to do this? The completion handler on -presentedViewController:animated:completion: notifies you when the presentation is complete and it is safe to present another view controller. > -Carl > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com > > This email sent to david.dun...@apple.com -- David Duncan _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com