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 743265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:50:34+00:00 2026-05-14T08:50:34+00:00

I am new to iPhone development. I am converting the date to the desired

  • 0

I am new to iPhone development. I am converting the date to the desired format and set it to the delegate and get its value in the another view. The session restarts when I tried to get the value from delegate. If I set the original date and not the formatted date in the set delegate, then I able to get the value in the another view. If I also give any static string value, then also I am able to the static string value back.

Only the formatted date which is string is set then the session restarts. If I print and check the value of the formatted date it prints the correct formatted date only. Here is my code for date conversion

NSString *dateval=[[stories objectAtIndex: storyIndex] objectForKey:@"date"];

NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];

[inputFormatter setDateFormat:@"EEE, MMM dd, yyyy"];

NSDate *inputDate = [inputFormatter dateFromString:dateval];

NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];

[outputFormatter setDateFormat:@"MMMM dd"];

NSString *outputDate = [outputFormatter stringFromDate:inputDate];  

AppDelegate *delegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];

[delegate setCurrentDates:outputDate];

Edit

This is displayed in console

inside view did load

[Session started at 2010-04-21 19:12:53 +0530.]
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 4216.
(gdb) 

In another view

 - (void)viewDidLoad {
NSLog(@"inside view did load");
AppDelegate *delegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
NSString *titleValue=[delegate getCurrentDates];
self.navigationItem.title =titleValue ;
}

The get does not work properly. It works fine if I give any static string or the "dateval".

  • 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-14T08:50:35+00:00Added an answer on May 14, 2026 at 8:50 am

    outputDate does not seems to be retained, so the value is lost at the end of the event loop (because of the NSAutoreleasePool).

    You should retain the outputDate to avoid its release with something like that in the delegate:

    - (void)setCurrentDates:(NSString *)value {
        [value retain]; // <- Retain new value
        [date release]; // <- Release old value;
        date = value;
    }
    

    The best solution would be to have a declared property in the delegate with the retain attribute.

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

Sidebar

Related Questions

i am new to iphone development. In my input date format is 2010-03-05T18:20:40Z, and
I'm new to iPhone development. I'm working on a table view (default UITableView subclass)
I am very new to Android development. I am converting my iPhone app to
New to iPhone development and working through exercises and examples to get me up
Im new to iphone development. here i want to view the screen like landscape
I'm new to iphone development.I have practiced some view based application programs and console
i m new to iphone development i want to create a view like this..
i am new in iphone development, i am using table view to list name
Im new to iPhone development and I have really taken this to me. I
I'm pretty new to iPhone development but I'm close to releasing my first app

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.