Update stringForObjectValue:

This commit is contained in:
Gregory John Casamento 2019-11-06 00:19:23 -05:00
parent 9e96cbd1c8
commit ba3d60c5ab
2 changed files with 13 additions and 6 deletions

View file

@ -107,11 +107,12 @@ GS_NSByteCountFormatter_IVARS;
- (BOOL) zeroPadsFractionDigits;
- (void) setZeroPadsFractionDigits: (BOOL)flag;
/* Beta methods... not yet implemented.
- (NSString *)stringForObjectValue: (id)obj;
- (NSString *)stringFromMeasurement
*/
- (NSString *) stringForObjectValue: (id)obj;
/* Beta methods...
- (NSString *) stringFromMeasurement: (NSMeasurement *)measurement;
End beta methods. */
- (NSString *)stringFromByteCount: (long long)byteCount;
+ (NSString *)stringFromByteCount: (long long)byteCount

View file

@ -69,7 +69,13 @@ GS_PRIVATE_INTERNAL(NSByteCountFormatter)
- (NSString *)stringForObjectValue: (id)obj
{
long long byteCount = [obj longLongValue];
long long byteCount = 0;
if([obj respondsToSelector: @selector(longLongValue)])
{
byteCount = [obj longLongValue];
}
return [self stringFromByteCount: byteCount];
}