Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
First, review the Apple docs for the UIAlertView Class Reference.
The important point to know is that you must use a delegate method to execute any custom actions from the AlertView other than the default "dismiss" or "cancel" methods.
Your current viewController in which the AlertView is created can be the delegate. To implement that just assign it to be the delegate in the init method when you create the alertView:
In this method you can define custom actions to execute after acknowledging or dismissing the alertView. The key to this method is that you refer to specific dismiss buttons by index #. The buttons are indexed by integers starting at 0. If you have 3 buttons then the 3rd button is index 2. You use this one method for several different alertViews since the alertView and button pressed is passed to the method when dismissed. Then in the dismiss method include your button specific actions as conditional statements:
Replies
The important point to know is that you must use a delegate method to execute any custom actions from the AlertView other than the default "dismiss" or "cancel" methods.
Your current viewController in which the AlertView is created can be the delegate. To implement that just assign it to be the delegate in the init method when you create the alertView:
The reference to "self" as the delegate refers to the viewController from which this code is being executed.
In the delegate viewController you then must add the delegate protocol declaration in the viewController .h file.
Then in the viewController .m file you must include the alertView delegate method:
In this method you can define custom actions to execute after acknowledging or dismissing the alertView. The key to this method is that you refer to specific dismiss buttons by index #.
The buttons are indexed by integers starting at 0. If you have 3 buttons then the 3rd button is index 2.
You use this one method for several different alertViews since the alertView and button pressed is passed to the method when dismissed.
Then in the dismiss method include your button specific actions as conditional statements:
If I left anything out you should be able to find it in the documentation.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome