title: Set expiry date for my app for 1 month
body: <p>Have to set expiry date for my app.
  At present, I am storing the date when the app is opened and the code goes  like this</p>
  
  <pre><code>NSError *error;
  NSEntityDescription *entityDesc = [NSEntityDescription entityForName:@"ExpiredDate" inManagedObjectContext:context];
  NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]init];
  [fetchRequest setEntity:entityDesc];
  NSArray *fetchedObjects = [[context executeFetchRequest:fetchRequest error:&amp;error] retain];
  
  [fetchRequest release];
  
  if([fetchedObjects count ]&lt;=0)
  {
      NSDate *todays=[[NSDate alloc]init];
  
      NSDateFormatter *date=[[NSDateFormatter alloc]init];
      [date setDateFormat:@"MM/DD/YYYY"];
      [date stringFromDate:todays];
     NSString *datelabel = [NSString stringWithFormat:@"%@",
                              [date stringFromDate:todays]];
  
  
  
      NSManagedObject *objUser;
      NSError *error;
  
      objUser = [NSEntityDescription insertNewObjectForEntityForName:@"ExpiredDate" inManagedObjectContext:context];
      [objUser setValue:datelabel forKey:@"date"];                 
  
      if (![context save:&amp;error]) 
      {
          NSLog(@"Problem saving: %@", [error localizedDescription]);
      }
  
  
  
  }
  else
  {
      for(int i=0; i&lt; [fetchedObjects count]; i++)
      {
          edate = [fetchedObjects objectAtIndex:i];
  
      }
  
      NSLog(@"%@",edate.date); 
     if(onemonth)
      {
      alertview:if one month completed then i have to show a pop up.please upgrade            }
     else
      {
          my code should execute
      }
  }
  </code></pre>
  
  <p>Now, I just want to count the date (which I have stored and I am storing like a string) for one month with current date and if month crossed then I have to show a pop up like please upgrade.</p>