1

warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.4 (8K2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).

- (void)showReminder:(NSString *)text
{
    NSLog(@"alert text>>%@",text);
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Reminder" 
                                                        message:text delegate:self
                                              cancelButtonTitle:@"Ok"
                                              otherButtonTitles:@"Snooze",nil];
    [alertView show];

    [alertView release];

}


-(void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{

NSString *title = [alertView buttonTitleAtIndex:buttonIndex]; 

    NSLog(@"alert title>>%@",title);
    if(buttonIndex == 0)  
    {  
        NSLog(@"Button 1 was selected.");  
    }  
    else if([title isEqualToString:@"Snooze"])  
    {  
        NSLog(@"check")
    }

}
swetank
  • 292
  • 1
  • 4
  • 17
  • its giving me bad excess – swetank Aug 29 '12 at 12:04
  • Check at which point the application is crashing by putting breakpoint inside **clickedButtonAtIndex** method. – Nitish Aug 29 '12 at 12:06
  • Also it does not seems fine that you are checking buttonIndex in first condition and a string comparison in second condition. – Nitish Aug 29 '12 at 12:10
  • its crashing when i click on either ok or snooze button on alert i.e its not entering the delegate method mentioned above... – swetank Aug 29 '12 at 12:11
  • Did you put breakpoint at following line : NSString *title = [alertView buttonTitleAtIndex:buttonIndex]; – Nitish Aug 29 '12 at 12:15
  • yes but control does not reach there.... warning comes before entering into clickedButtonatIndex – swetank Aug 29 '12 at 12:29
  • What exact message you get in log? – Nitish Aug 29 '12 at 12:30
  • Program received signal: “EXC_BAD_ACCESS”. warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.4 (8K2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found). – swetank Aug 29 '12 at 12:33
  • i am facing the same problem plz let me know if u find the answer ...thanks –  Aug 29 '12 at 12:43
  • thanks to every one i finally got the solution .....it was a memory management issue. – swetank Aug 30 '12 at 04:06

2 Answers2

0

Why not have this instead:

- (void)showReminder:(NSString *)text {

   NSLog(@"alert text>>%@",text);
   UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Reminder" 
                                                 message:text 
                                                 delegate:self
                                                 cancelButtonTitle:@"Ok"
                                                 otherButtonTitles:@"Snooze",nil];
   [alertView show];

   [alertView release];

}


-(void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{    

    if(buttonIndex == 0)  {  
       NSLog(@"Button 1 was selected.");  
    }  
    else if(buttonIndex == 1){  
        NSLog(@"check")
    }

}

when buttonIndex is 1 then that is your snooze button. If you have other alerts then just apply a tag in showReminder alertView.tag = 1 and in your clickedButtonAtIndex add an outer if saying

if(alertView.tag==1)

And for that error check out this question. They seem to have solved how to fix the missing symlink you need

Community
  • 1
  • 1
BigT
  • 1,413
  • 5
  • 24
  • 52
0

Respond to Alert Button Selection

@interface ViewController : UIViewController <UIAlertViewDelegate> {

Create UIAlertview

UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Hello World!"
                                              message:@"This is your first UIAlertview message."
                                             delegate:self
                                    cancelButtonTitle:@"Button 1"
                                    otherButtonTitles:@"Button 2", @"Button 3", nil];
[message show];

And

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSString *title = [alertView buttonTitleAtIndex:buttonIndex];

    if([title isEqualToString:@"Button 1"])
    {
        NSLog(@"Button 1 was selected.");
    }
    else if([title isEqualToString:@"Button 2"])
    {
        NSLog(@"Button 2 was selected.");
    }
    else if([title isEqualToString:@"Button 3"])
    {
        NSLog(@"Button 3 was selected.");
    }
}
Wolverine
  • 4,264
  • 1
  • 27
  • 49