Severity
Severity determines defect's effect on the application
Priority
Determines defect's urgency for repair
Defect
Severity determines defect's effect on the application
Priority
Determines defect's urgency for repair
Defect
mutableCopy
, modify that, and set it back again. NSMutableArray *placesT= nil;
NSrray *tempArray = [[NSUserDefaults standardUserDefaults] objectForKey:@"placesT"];
if (tempArray) {
placeT = [tempArray mutableCopy];
} else {
placesT=[[NSMutableArray alloc] init];
}
[placesT addObject: [NSString stringWithFormat:@"%@", tagF.text] ];
NSUserDefaults *tUD=[NSUserDefaults standardUserDefaults];
[tUD setObject:placesT forKey:@"placesT"];
[tUD synchronize];
-(NSString *)dateDiff:(NSString *)origDate {
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setFormatterBehavior:NSDateFormatterBehavior10_4];
[df setDateFormat:@"EEE, dd MMM yy HH:mm:ss VVVV"];
NSDate *convertedDate = [df dateFromString:origDate];
[df release];
NSDate *todayDate = [NSDate date];
double ti = [convertedDate timeIntervalSinceDate:todayDate];
ti = ti * -1;
if(ti < 1) {
return @"never";
} else if (ti < 60) {
return @"less than a minute ago";
} else if (ti < 3600) {
int diff = round(ti / 60);
return [NSString stringWithFormat:@"%d minutes ago", diff];
} else if (ti < 86400) {
int diff = round(ti / 60 / 60);
return[NSString stringWithFormat:@"%d hours ago", diff];
} else if (ti < 2629743) {
int diff = round(ti / 60 / 60 / 24);
return[NSString stringWithFormat:@"%d days ago", diff];
} else {
return @"never";
}
}
2.If NSDateFormatter returns nil then use the below method to fix
NSDateFormatter *parser = [[NSDateFormatter alloc] init];
[parser setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]];