Questions tagged [cocoa]

Cocoa is Apple's application-development framework for macOS, consisting of Foundation, Application Kit, and Core Data. Use the "cocoa-touch" tag for iOS questions.

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

The Cocoa frameworks consist of libraries, APIs and runtimes that form the development layer for all of macOS.

Related tags

Debugging Techniques

Cocoa programs can be debugged with many techniques and tools, both general and specific to Objective-C, Xcode and macOS.

External Resources

General Resources on SO

Memory Management

More information

39610 questions
14
votes
3 answers

Tool for automated UI testing for Mac OS X (Cocoa) apps

Is there any open-source free tool for automated UI testing for Mac OS X (Cocoa) apps? So far I've seen commercial tools such as [Squish] and [EggPlant]. The only free tools I've read about are using UIAutomation or Automator. Does anyone have any…
soguy
  • 265
  • 1
  • 3
  • 10
14
votes
3 answers

How can I programmatically check free system memory on Mac like the Activity Monitor does?

On Mac OS X, I can see how much memory is free in Activity Monitor. How can I programmatically do this?
backspacer
  • 918
  • 1
  • 10
  • 19
14
votes
2 answers

What is the difference between int and NSInteger?

Possible Duplicates: When to use NSInteger vs int? Why is there is an NSInteger? Can we use int and NSInteger interchangably? Is there any specific situation to use NSInteger only, instead of using int?
Prasad
  • 1,904
  • 4
  • 19
  • 24
14
votes
2 answers

How to handle arrow key event in Cocoa app?

How to handle arrow key event in Cocoa app?
eonil
  • 83,476
  • 81
  • 317
  • 516
14
votes
3 answers

How to determine whether an NSSearchField/NSTextField has input focus?

How can I determine whether an NSSearchField/NSTextField has input focus?
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
14
votes
7 answers

What describes an "Outlet" best in objective-c / Cocoa?

Can someone explain in an humanly understandable way what an "Outlet" is?
Thanks
  • 40,109
  • 71
  • 208
  • 322
14
votes
5 answers

Cocoa NSArray/NSSet: -makeObjectsPerformSelector: vs. fast enumeration

I want to perform the same action over several objects stored in a NSSet. My first attempt was using a fast enumeration: for (id item in mySetOfObjects) [item action]; which works pretty fine. Then I thought of: [mySetOfObjects…
mouviciel
  • 66,855
  • 13
  • 106
  • 140
14
votes
4 answers

mutating method sent to immutable object

When I use this method first time it works fine, but when I called it second time I get the error "mutating method sent to immutable object". The problem is at line with "addObject" command. -(IBAction) save: (id) sender{ NSMutableArray *placesT=…
gbaor
  • 1,419
  • 3
  • 11
  • 19
14
votes
2 answers

Get Certificates in Keychain

I've looked over the Security framework documentation but I can't seem to be able to find a way to get all of the certificates on a given keychain. Are there methods to accomplish this?
Dylan Copeland
  • 1,249
  • 1
  • 11
  • 20
14
votes
3 answers

Cocoa : How to make multiline NSTextField?

How to make multiline NSTextField? UPDATE: I've found in IB special type of NSTextField called "Wrapped Text Field". It is multiline but when I want get a newline I have to press Ctrl+Enter. But I want to press only Enter to get a newline. How can I…
Siarhei Fedartsou
  • 1,843
  • 6
  • 30
  • 44
14
votes
2 answers

Sorting a NSArrayController backed NSTableView

I have a NSArrayController and a NSTableView. They show tracks from iTunes. I can sort the list by clicking in the header. Is there a way to set up a default sort descriptor for the table view so it sorts for albums every time the user launches the…
david
  • 3,553
  • 4
  • 28
  • 39
14
votes
2 answers

Assembly GUI programming for Mac OS X

I’d like to know how can I do a simple assembly program for Mac OS X that shows a window on the screen and put some coloured text on that window. The code may call some Carbon or Cocoa APIs. I need some code for the nasm sintaxe. I saw in …
jose.pereira
  • 141
  • 1
  • 3
14
votes
2 answers

How to launch system preferences to a specific preference pane using bundle identifier?

I'm trying to open the system date & time preferences directly from my app. I can seem to open System Preferences with no issue using: let settingsBundleIdentifier =…
santi_
  • 191
  • 1
  • 8
14
votes
6 answers

NSManagedObjectID into NSData

I found this wonderful NSManagedObjectID. This would be very good for referencing an Entity/NSManagedObject/NSEntityDescription, right? Let's get an ID from an entity: NSEntityDescription *entity = [self newEntity]; NSManagedObjectID *objID =…
papr
  • 4,717
  • 5
  • 30
  • 38
14
votes
2 answers

Adding a custom view to toolbar

I'm struggling with Cocoa for 2 hours now without success. I want to add a custom view to the toolbar. So, I added a NSToolbar to the window (with IB), and added my view (which works perfectly). IB automatically created a NSToolbarItem. I followed…
user531461