CFNumberFormatterCreateStringWithNumber
과 관련된 문제가 있습니다.CFNumberFormatterCreateStringWithNumber int issue
// Works fine with float:
float n = 1.20;
CFNumberRef value = CFNumberCreate(NULL, kCFNumberFloatType, &n);
CFLocaleRef currentLocale = CFLocaleCopyCurrent();
// Create different number formatters
CFNumberFormatterRef decimalFormatter = CFNumberFormatterCreate(NULL, currentLocale, kCFNumberFormatterDecimalStyle);
CFStringRef decimalString = CFNumberFormatterCreateStringWithNumber(NULL, decimalFormatter, value);
// Using an INT I see an issue
int n = 892385;
CFNumberRef value = CFNumberCreate(NULL, kCFNumberSInt32Type, &n);
CFLocaleRef currentLocale = CFLocaleCopyCurrent();
// Create different number formatters
CFNumberFormatterRef decimalFormatter = CFNumberFormatterCreate(NULL, currentLocale, kCFNumberFormatterDecimalStyle);
CFStringRef decimalString = CFNumberFormatterCreateStringWithNumber(NULL, decimalFormatter, value);
/// release, release, release
(대신 부동의) int 값을 사용할 때 표시되는 오류는 다음과 같습니다 : 거기
<CFNumber 0x5ac27 [0x7fff9856ed80]>{value = +1452, type = kCFNumberSInt32Type}
2017-03-05 21:42:06.789577 HID_Dumper[4390:150864] -[__NSCFNumber _getCString:length:multiplier:]: unrecognized selector sent to instance 0x2e4027