Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
You said "this dose not work". That is really, really NOT helpful.
What does it do? What date strings are you testing it with, and what are you getting as a result? Be specific, man!
Sorry for not providing details about the requirement in detail.
I am tring to get date from the system date using "NSDate" and this should be sorted(most recent first) and displayed as "MMM dd yyyy" (Ex: Dec 25 2012).
So i am tring to get the date and assigning it to a NSDate variable, using the below code. But at the end i am left with a NIL value in the log.
Sorry for not providing details about the requirement in detail.
I am tring to get date from the system date using "NSDate" and this should be sorted(most recent first) and displayed as "MMM dd yyyy" (Ex: Dec 25 2012).
So i am tring to get the date and assigning it to a NSDate variable, using the below code. But at the end i am left with a NIL value in the log.
You are getting nil because you are trying to convert a string that is not in the format that you specified in the date formatter and converting it to an NSDate.
It has no idea how to convert your string.
You are getting nil because you are trying to convert a string that is not in the format that you specified in the date formatter and converting it to an NSDate.
It has no idea how to convert your string.
yes what you specified is working, but my requirement is to get the date in "dd MMM yyyy" format.
thanks for the help.
I am still not able to get the desired output.
Your output and usable string IS in day month year format:
See line:
NSLog(@"Date String: %@", dateString);
NSDate does not have a format in itself. NSDateFormatter simply translates dates to strings and visa versa based on a format and other optional variables such as locale.