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: Michael Crawford <email@hidden>
- Date: Sat, 25 Apr 2015 04:56:47 -0700
I was running on an iPad. When I switched to the iPad 2 simulator, I
could enable Guard Malloc.
With guard malloc an assert is tripped over a retain count that, at
that point, should be 1.
I expect I have an errant pointer elsewhere in my code. I know how to
track such things down.
I'm not dead certain yet but something like this may ultimately work:
- (IBAction) doSave
{
[self performSelector: delayedSave withObject: nil afterDelay: 2.0];
}
- (void) delayedSave: (id) object
{
// prompt for file name with UIAlertView, then save the file
}
What I would prefer would be to have a guarantee that the action sheet
has already been dismissed before I display the alert. Just trying
out different ad-hoc delays seems a little sketchy.
On 4/25/15, Michael Crawford <email@hidden> wrote:
> My iOS App includes some simple file management, that enables the user
> to save the state of their game as well as to exchange the game states
> with other people.
>
> I have a sheet that looks like this:
>
> Title: File Management
> Destructive Option: Delete File
> Open
> Save
>
> I also specify a "Cancel" item which does not display on the iPad, as
> the user can cancel by tapping outside.
>
> When they tap Save I want to prompt the user for a filename with
> UIAlertView. This is where my question came up before, regarding that
> alert having zero size. I'm using the newer API now, with the style
> that prompts for text.
>
> If I do it in a straightforward way the alert is not displayed.
>
> If I called "usleep( 1500000 )" the alert is briefly displayed then
> dismissed.
>
> My delegate's "clickedButtonAtIndex" method is never called.
>
> I think the problem is that I need to be certain that the action sheet
> is all the way dismissed before I show the alert. I think that's what
> all the stuff about runloops was in my previous question, that didn't
> make sense to anyone. I got that from Erica Sadun's "iPhone
> Developer's Cookbook".
>
> I expect what's happening is that the user taps "Save" in the action
> sheet, then the iOS calls my "doSave" IBAction, then ultimately from
> doSave, the alertview is displayed. That leads to the instantiation
> of the alertview being - indirectly - a subroutine of the action
> sheet.
>
> Maybe it would work if doSave called NSObject's "performSelector" I'll
> give that a try while I eagerly await your responses.
>
> Mike
> --
> Michael David Crawford, Consulting Software Engineer
> email@hidden
> http://www.warplife.com/mdc/
>
> Available for Software Development in the Portland, Oregon Metropolitan
> Area.
>
--
Michael David Crawford, Consulting Software Engineer
email@hidden
http://www.warplife.com/mdc/
Available for Software Development in the Portland, Oregon Metropolitan
Area.
_______________________________________________
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