1

警告:无法读取 /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.4 (8K2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib 的符号(找不到文件)。

- (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")
    }

}
4

2 回答 2

0

响应警报按钮选择

@interface ViewController : UIViewController <UIAlertViewDelegate> {

创建 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];

- (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.");
    }
}
于 2012-08-29T12:57:57.847 回答
0

为什么不使用这个:

- (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")
    }

}

什么时候buttonIndex是 1,那是你的贪睡按钮。如果您有其他警报,那么只需在 showReminder 中应用一个标签,alertView.tag = 1并在您clickedButtonAtIndex添加一个外部如果说

if(alertView.tag==1)

对于该错误,请查看此问题。他们似乎已经解决了如何修复您需要的缺失符号链接

于 2012-08-29T12:55:24.040 回答