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

代わりにこれを使用しないでください:

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

}

whenbuttonIndexが 1 の場合、それがスヌーズ ボタンです。他のアラートがある場合は、showReminder にタグを適用しalertView.tag = 1clickedButtonAtIndex外側の if を追加するだけです

if(alertView.tag==1)

そして、そのエラーについては、この質問をチェックしてください。彼らは、必要なシンボリックリンクの欠落を修正する方法を解決したようです

于 2012-08-29T12:55:24.040 に答える
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 に答える