-(void)requestdata
{
NSDictionary *dict=@{@"entity_id":[[[NSUserDefaults standardUserDefaults] valueForKey:@"logInDetails"] valueForKey:@"entity_id"],
};
[SingletonClass GetDetails:[NSString stringWithFormat:@"http://gsarrow.com/web_service_deals/referral_friend_history.php"] withParams:dict :^(id jsondata, BOOL success){
dispatch_async(dispatch_get_main_queue(), ^{
if (success)
{
NSLog(@"%@",jsondata);
array = [jsondata valueForKey:@"data"];
NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"created_at" ascending:YES];
array = [array sortedArrayUsingDescriptors:@[descriptor]];
NSString *oldMonth=@"";
for (NSDictionary *d in array)
{
NSString *dateStr=[d valueForKey:@"created_at"];
NSLog(@"date%@",dateStr);
NSDateFormatter *dformat = [[NSDateFormatter alloc]init];
[dformat setDateFormat:@"MM/dd/yyyy HH:mm:ss"];
NSDate *date1=[[NSDate alloc]init];
date1=[dformat dateFromString:dateStr];
[dformat setDateFormat:@"MMMM"];
NSString *month = [dformat stringFromDate:date1];
What I have tried:
this my code and tried with break points and for(NSDictionary *d in array) from its not executing