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

learn more… | top users | synonyms

0
votes
0answers
33 views

Fullscreen overlay NSWindow using constrainFrameRect(_:toScreen:)

A project I'm working on requires a fullscreen overlay NSWindow that must be trusted to stay fullscreen no matter what. Rather than subscribing to ...
3
votes
0answers
687 views

Multiple View Controllers in a Single Window (Swift on OS X)

As an exercise I want to have a single window application (in Swift on Mac OS X) with 4 views, each controlled by an independent view controller and have their own XIB file. I have working code, but I ...
4
votes
1answer
97 views

Non-concurrent write creates bottleneck

I have some efficient methods that recursively creates a tree structure (NSTreeNode) of by looping recursively over a directory structure. The result is displayed ...
5
votes
2answers
857 views

Spawning a Dog class

When the app is run on an iPhone or simulator, tapping the screen spawns a dog class and displays an image of the dog. I'd like comments, issues, whatever. Is this a decent first Objective-C project, ...
5
votes
1answer
2k views

Presenting modal dialogs from XIB in Cocoa: best/shortest pattern?

Below is my typical WindowController module for presenting a modal dialog (could be settings, asking username/password, etc) loaded from a XIB. It seems a bit too complex for something like this. Any ...
2
votes
1answer
714 views

Reviewing C function which captures the screen

I have created a function in C on OSX in Xcode which captures the screen, adds the mouse pointer to the image, rescales the image to fit a certain width X height requirement, and puts the rescaled ...
4
votes
1answer
111 views

Is there a better way to make sure a variable is initialized when using blocks?

I have a method to provide an NSManagedObjectContext using UIManagedDocument. I need to ensure that the ...
3
votes
1answer
2k views

Spliting string to array by number

I have two functions to split string to array of strings. Input string is: (1Letter E|V|R) + 8 number, last component of string (1Letter + V) + 8 or less numbers. I'v got two functions advised to ...
3
votes
2answers
402 views

Storing and iterating over multiple NSError pointers

How would you refactor this kind of code? I've unsuccessfully tried several approaches (NSArray, NSPointerArray, plain C array), but always ran into pointer type checking error. ...
2
votes
4answers
475 views

Is there anything wrong with this unusual NSMutableArray setter?

This behaves to an outside observer mostly like @property (copy), except it has the very nice property of automatically performing any side effects that may exist ...
3
votes
1answer
226 views

How could this constructor code be improved?

How could this constructor code be improved? I feel like I'm not doing something optimally here... ...
2
votes
1answer
266 views

Server-loaded buildings function for an iOS game

I'm working on a game for iOS devices and this is the function we use to create server-loaded buildings. The server loading is in another function and everything works just fine, but I was wondering ...
5
votes
1answer
554 views

OpenGL game edit view

I'm working on a Cocoa project that uses OpenGL. I'm trying to keep things easily cross-platformable for later (which is the primary reason for my GL singleton; I hope to implement Linux versions of ...
1
vote
2answers
493 views

Setting the path to toolbarAssociatedXibName, with fallback

I have some code that I've included in a project I want to release. Here is one such block: ...
3
votes
3answers
596 views

Initializing a window in Cocoa

This is some of the code I have: ...