
Simple example of UIAlertView with Title, Message and OK / Cancel Buttons also how to determine if button is clicked?

Hope this is useful for you.
<HTML>
<script>
var flag=confirm("Do you want to continue");
alert(flag);
</script>
<BODY>
</BODY>
</HTML>
Chandraprakash Sarathe
-------------------------------------
http://javaved.blogspot.com/

Script code is not interpreted , please append <>
script
var flag=confirm("Do you want to continue");
alert(flag);
script

initWithTitle UIAlertView
Simple example of UIAlertView with Title, Message and OK / Cancel Buttons also how to determine if button is clicked?
In Objective C UIAlertView enable you to send an alert to user or you can ask for the permission such as.. in map View it ask for using current location or not.
As far as Title, Messages and Buttons are concern they are the properties of UIAlertView and you can set it like?
? initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:
To show the alert view there is a method called : (- Show ) and to dismiss it, Write the given code.
? dismissWithClickedButtonIndex:animated:

Example of UIAlertView Title, Message and Buttons
- (void)showConfirmAlert
{
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle:@"Confirm"];
[alert setMessage:@"Do you pick Yes or No?"];
[alert setDelegate:self];
[alert addButtonWithTitle:@"Yes"];
[alert addButtonWithTitle:@"No"];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0)
{
// Yes, do something
}
else if (buttonIndex == 1)
{
// No
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.