• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UIAlertView Confirmation Delete or Cancel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UIAlertView Confirmation Delete or Cancel


  • Subject: UIAlertView Confirmation Delete or Cancel
  • From: Steven Haas <email@hidden>
  • Date: Fri, 10 Jul 2009 07:49:00 -0400

Below is the code from Apple's example application call SQLiteBooks. What I was trying to do is simply create a UIAlertView, that asks the user if they are sure they want to delete the book. I am not sure how to incorporate this properly.

// Remove a specific book from the array of books and also from the database.
- (void)removeBook:(Book *)book {


// Delete from the database first. The book knows how to do this (see Book.m)
[book deleteFromDatabase];
[books removeObject:book];
}





- (void) alertDeleteConfirm:(UIAlertView *)alertDeleteConfirm clickedButtonAtIndex:(NSInteger)buttonIndex
{
{
if (buttonIndex == 0)
{
// do nothing just cancel


		}

		if (buttonIndex == 1)
		{
			// delete action

		}
	}

}

- (void) UIAlertView *alertDeleteConfirm = [[UIAlertView alloc] initWithTitle:@"Confirm Delete" message:@"Are you sure you want to delete the book from the application?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Delete", Nil];
[alertDeleteConfirm show];
[alertDeleteConfirm release];
_______________________________________________


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


  • Prev by Date: Re: Announcement + NSSegmentedCell drawing question
  • Next by Date: Can't figure out where the memory leak comes from.
  • Previous by thread: Re: UIWebview issues
  • Next by thread: Can't figure out where the memory leak comes from.
  • Index(es):
    • Date
    • Thread