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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to