Problem in dateFormatter in Iphone sdk?
- by user133611
Hi Guys,
Actually My code is:
else if(isExpense == YES)
{
NSDate *strDate;
strDate = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"dd-MM-yyyy"];
if([expense.date length] > 0)
{
NSDate *date = [dateFormatter dateFromString:expense.date];
datePicker.date = date; //Here date value is passing nil and Im getting Exception
}
else
{
datePicker.date = strDate;
}
}
Guys can anyone help to get out of this problem?????
Anyone's help will be much appreciated.
Thank You,
Kiran.