Top "Cocoa" questions

Cocoa is Apple's application-development framework for macOS, consisting of Foundation, Application Kit, and Core Data.

Exception thrown in NSOrderedSet generated accessors

On my Lion app, I have this data model: The relationship subitems inside Item is ordered. Xcode 4.1 (build 4B110) has …

cocoa core-data xcode4
Cocoa Custom Notification Example

Can someone please show me an example of a Cocoa Obj-C object, with a custom notification, how to fire it, …

objective-c cocoa notifications
Using a constant NSString as the key for NSUserDefaults

I'm using NSUSerDefaults to store user preferences. I remember reading somewhere that setting the keys as constants is a good …

objective-c cocoa default-value
NSCalendar first day of week

Does anyone know if there is a way to set the first day of the week on a NSCalendar, or …

iphone cocoa calendar weekday nscalendar
How to create a NSString from a format string like @"xxx=%@, yyy=%@" and a NSArray of objects?

Is there any way to create a new NSString from a format string like @"xxx=%@, yyy=%@" and a NSArray of …

objective-c cocoa nsstring nsarray string-formatting
Why can't code inside unit tests find bundle resources?

Some code I am unit testing needs to load a resource file. It contains the following line: NSString *path = [[NSBundle …

cocoa unit-testing xcode nsbundle octest
How do I create an MD5 Hash of a string in Cocoa?

I know SHA-1 is preferred, but this project requires I use MD5. #include <openssl/md5.h> - (NSString*) …

objective-c cocoa hash md5
What's the optimum way of storing an NSDate in NSUserDefaults?

There's two ways of storing an NSDate in NSUserDefaults that I've come across. Option 1 - setObject:forKey: // Set NSDate *myDate = […

cocoa datetime nsdate nsuserdefaults nstimeinterval
Avoiding "NSArray was mutated while being enumerated"

I have an NSMutableArray that stores mousejoints for a Box2d physics simulation. When using more than one finger to …

objective-c cocoa cocoa-touch collections nsmutablearray
How do I break down an NSTimeInterval into year, months, days, hours, minutes and seconds on iPhone?

I have a time interval that spans years and I want all the time components from year down to seconds. …

iphone cocoa time nstimeinterval