Top "Cocoa" questions

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

Objective-C - Remove last character from string

In Objective-C for iOS, how would I remove the last character of a string using a button action?

ios objective-c string cocoa cocoa-touch
How to compare two dates in Objective-C

I have two dates: 2009-05-11 and the current date. I want to check whether the given date is the …

objective-c cocoa date date-comparison
Is It Possible to NSLog C Structs (Like CGRect or CGPoint)?

I want to be able to debug C structures without having to explicitly type every property that they consist of. …

c objective-c cocoa cocoa-touch
Getting a list of files in a directory with a glob

For some crazy reason I can't find a way to get a list of files with a glob for a …

ios objective-c iphone cocoa cocoa-touch
Using NSPredicate to filter an NSArray based on NSDictionary keys

I have an array of dictionaries. I want to filter the array based on a key. I tried this: NSPredicate *…

objective-c cocoa nsarray nsdictionary nspredicate
Get Current date & time with [NSDate date]

My system's date time is 26 May 22:55 but when i get date with [NSDate date] date time is 27 May 02:35 is it …

objective-c cocoa nsdate
Remove all whitespaces from NSString

I've been trying to get rid of the white spaces in an NSString, but none of the methods I've tried …

objective-c string cocoa nsstring
Understanding NSString comparison

Both the following comparisons evaluate to true: 1) @"foo" == @"foo"; 2) NSString *myString1 = @"foo"; NSString *myString2 = @"foo"; myString1 == myString2; However, there are …

objective-c cocoa nsstring string-comparison
How to perform Callbacks in Objective-C

How to perform call back functions in Objective-C? I would just like to see some completed examples and I should …

objective-c cocoa callback
Rounding numbers in Objective-C

I'm trying to do some number rounding and conversion to a string to enhance the output in an Objective-C program. …

objective-c cocoa macos formatting rounding