Re: Display a UIAlertView after dismissing an action sheet?
Re: Display a UIAlertView after dismissing an action sheet?
- Subject: Re: Display a UIAlertView after dismissing an action sheet?
- From: Mike Abdullah <email@hidden>
- Date: Sat, 25 Apr 2015 15:21:13 +0200
> On 25 Apr 2015, at 15:06, Michael Crawford <email@hidden> wrote:
>
> On 4/25/15, Roland King <email@hidden> wrote:
>> There are delegate methods for UIActionSheet and UIAlertView which tell you
>> when the animation has finished.
>>
>> xxx:didDismissWithButtonIndex:
>
> You Da Man.
>
> I am closer to understanding why this is not working.
>
> my call to "[alertView show]" returns immediately. At some later
> point the UIAlertView actually appears on screen. If I then tap a
> button, the UIAlertViewDelegate's clickedButtonAtIndex method is
> called.
>
> However the logic I presently have in my code is:
>
> NSString baseName = [ModalAlertView copyFilename];
>
> where copyFilename is a class method. If it calls [alertView show],
> which returns immediately then I need a way to wait around until the
> button is clicked. At that point I check for an existing file and
> potentially show another alert - without a text field - to ask whether
> they want to overwrite an existing file.
>
> I expect I can work out logic that will accomplish what I need but
> this must be a common problem, can anyone suggest a solution to this?
>
> Another way to put it is that I want to prompt for a filename, and
> verify any overwrite, in a synchronous manner.
Apple’s APIs here are deliberately asynchronous. You need to make your code handle that properly. Don’t try to force it to be synchronous.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden