Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7034641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:12:39+00:00 2026-05-28T01:12:39+00:00

I have an application in which i have button. When i click on button

  • 0

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:-

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);

        [[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];

// if(appDelegate.appDelegate_notification ==nil)
// appDelegate.appDelegate_notification= [[UILocalNotification alloc] init];
appDelegate.appDelegate_notification=ln;
[ln release];

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:-

appDelegate.appDelegate_notification.soundName = @”Blow.wav”;

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?

Thanks in advances…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:12:39+00:00Added an answer on May 28, 2026 at 1:12 am

    When we generate any local notification then we can set sound file at that time . If we want to set sound after setting notification then i get only one way that i share here. When we edit any sound of alert then first we have to save fire date of alert and after that we will cancel that alert and set a new alert with same fire date anad this time we will pass new sound file. I use this and working fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application is viewbased application in which I have one button. On click of
I have a button in my application which is bound to a command. This
I am developing an application in which on my button click I have to
I have an application which extracts data from an XML file using XPath. If
I have a vb.net application which does some processing. This processing can take a
I have a Windows Forms application containing around 15 different buttons which on-click should
I have one Application which has more then 5 Activity I want to know
I a WPF application I have the following event-handler of a button-click in a
I have this web application which does the following as standard to all websites
I have an Android application which has a login screen. Upon the click of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.