- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
CGFloat ageInYears = self.user.age;
if (ageInYears < 1) {
CGFloat ageInSeconds = [[NSDate date] timeIntervalSinceDate:self.user.birthday];
ageInYears = floorf(ageInSeconds / (365.25 * 24.0 * 60.0 * 60.0));
}
// ...
profileInfoCell.schoolLabel.text = [NSString stringWithFormat:@"%.0f", ageInYears];