chockenberry / mobile-twitterrific

This is the Jailbreak version of Twitterrific
http://twitterrific.com/ios
26 stars 2 forks source link

Figure out how to handle errors and/or alerts #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The user needs to be alerted when things go wrong (or unexpectedly.) 
UIAlertSheet looks 
promising.

Original issue reported on code.google.com by craig.ho...@gmail.com on 19 Aug 2007 at 8:22

GoogleCodeExporter commented 9 years ago
- (void)alertSheet:(id)aSheet buttonClicked:(int)button;
{
    if(aSheet == sheet)
    {
        NSLog(@"Button Pressed On Alert = %i", button);
                //handle buttons.
        [sheet dismiss];
        [sheet release]; sheet = nil; 
    }
}
- (void)didDismissAlertSheet:(id)aSheet;
{
    //stuff to do when sheet goes away.
}

-(void)presentSheetForException:(NSException *)e
{
    UIAlertSheet *sheet = [[UIAlertSheet alloc] initWithFrame: CGRectMake(0, 240, 320, 240)];
    [sheet setDimsBackground:YES];
    [sheet setRunsModal:YES];
    [sheet setTitle:@"Error"];
    [sheet setBodyText:[NSString stringWithFormat:@"Debugging info: %@", [e reason]]];
    [sheet addButtonWithTitle:@"Try Again"];
    [sheet addButtonWithTitle:@"Cancel"];
    [sheet setDelegate: self];
    [sheet presentSheetFromAboveView: someViewGoesHere];
}

Original comment by saggau on 23 Aug 2007 at 6:58