Post

Replies

Boosts

Views

Activity

NSNumberFormatter wrongfully displays 16-bit unsigned int as signed
Hi all, My interface displays a text field bound to an NSNumber that I use internally as unsigned int. That NSNumber is actually saved with Core Data as Integer 16. However, the interface displays the number signed, meaning anything above 32.768 is actually shown to be negative. I couldn't find a way to force my NSNumberFormatter to display unsigned numbers. Setting the minimum value to 0 also doesn't work, since internally it's gonna be positive anyway. Could you help me display my 16-bit integer as an unsigned int between 0 and 65.535? I am building a macOS app using Objective-C, macOS SDK 10.14 and Xcode 14.3.1.
1
0
588
Aug ’23
Reasons behind Cocoa's error code 512 = NSFileWriteUnknownError
We are developing a document-based Objective-C project, using NSPersistentDocument and NSPersistentStore to save a unique binary file on disk. No autosave. Our application sometimes throws NSFileWriteUnknownError when trying to save the document, but the error description is obviously vague as this is an "unknown" error, not allowing us to debug easily. Why would such an unknown error be ever raised? Why doesn't Core Data know why it cannot save a file? We build using SDK 10.14 and run on macOS Monterey 12.3.1
1
0
1.1k
Aug ’22