2011-12-14 82 views
-1

如何重複UILocalNotification聲音?如何重複UILocalNotification聲音

-(IBAction) scheduleNotification1 { 

    local1 = [[UILocalNotification alloc] init]; 

    // create date/time information 
    local1.fireDate = [NSDate dateWithTimeIntervalSinceNow:2]; 
    local1.timeZone = [NSTimeZone defaultTimeZone]; 

    // set notification details 
    local1.alertBody = @"2!"; 
    local1.alertAction = @"View"; 


    //local1.soundName = UILocalNotificationDefaultSoundName; 
    //local1.soundName = @"alarmsound.caf"; 
    local1.soundName = @"29.mp3"; 
    // set the badge on the app icon 
    local1.applicationIconBadgeNumber = 1; 

    // local1.repeatInterval =NSSecondCalendarUnit;//// NSMinuteCalendarUnit; 
    //local1.repeatInterval =1 ; 
    // Gather any custom data you need to save with the notification 
    NSDictionary *customInfo = [NSDictionary dictionaryWithObject:@"ABCD2" forKey:@"yourKey1"]; 

    local1.userInfo = customInfo; 

    // Schedule it! 
    [[UIApplication sharedApplication] scheduleLocalNotification:local1]; 

    //[local1 release]; 

} 

請提供一些示例代碼。

+0

你是什麼問題? ??您能否詳細說明您的問題? – Maulik 2011-12-14 09:04:43

+0

@ a7mad你想要什麼指定你的問題 – Ron 2011-12-14 09:10:26

回答

0

對不起a7mad,我不敢說,但它是不可能重複UILocal通知的聲音。我希望你已經檢查了SO的其他問題。他們都有負面結果。

我可以給你一個建議,在點擊LocalNotification的「查看」按鈕的呼叫警報查看或ActionSheet並就繼續控制自己的行爲,因爲他們可以控制的...