Note that there are some explanatory texts on larger screens.

plurals
  1. POHow change the sound name of local notification?
    primarykey
    data
    text
    <p>I have an application in which i have button. When i click on button then generate a local notification. The variable of local notification is set in appDelegate file. For generate local notification i used this code:- </p> <blockquote> <p>UILocalNotification* ln = [[UILocalNotification alloc] init]; ln.alertBody = @"Time for another cup of coffee!"; ln.applicationIconBadgeNumber = 1; ln.fireDate = notification_date; //[NSDate dateWithTimeIntervalSinceNow:15]; ln.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"]; NSString *string_date=[formatter stringFromDate:notification_date]; NSDateFormatter* formatter_alarm = [[[NSDateFormatter alloc] init] autorelease]; formatter_alarm.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT"]; [formatter_alarm setDateFormat:@"hh:mm a"]; NSString *str=[formatter_alarm stringFromDate:notification_date]; appDelegate.alarm_time=[NSString stringWithFormat:@"%@",str]; NSLog(@"%@",appDelegate.alarm_time);</p> </blockquote> <pre><code> [[NSUserDefaults standardUserDefaults] setObject:appDelegate.alarm_time forKey:@"alarm_on_time"]; [[NSUserDefaults standardUserDefaults] setObject:string_date forKey:@"alarm_on_date"]; [[NSUserDefaults standardUserDefaults] synchronize]; NSLog(@"alarm will activate on%@",notification_date); ln.soundName = @"alarm.wav"; AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); ln.repeatInterval=NSDayCalendarUnit; [[UIApplication sharedApplication] scheduleLocalNotification:ln]; </code></pre> <p>// if(appDelegate.appDelegate_notification ==nil) // appDelegate.appDelegate_notification= [[UILocalNotification alloc] init]; appDelegate.appDelegate_notification=ln; [ln release];</p> <p>Now i have a another button which is used for change the sound of local notification. I wan t that when user click on that button then change the sound of local notification. For that purpose i use this code:-</p> <blockquote> <p>appDelegate.appDelegate_notification.soundName = @"Blow.wav";</p> </blockquote> <p>Now problem is that when i click on another button then sound of local notification is not changed. How make that event on button click?</p> <p>Thanks in advances...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload