objective-c-2

How to intercept a hot key in Cocoa when the application window is not active

I am trying to create a utility that doesn't open a window when executed, and that would be activated from a hot key; I read that currently Cocoa doesn't have a function for that, and that I should use a deprecated Carbon function. Isn't there really a way to use global hot keys in Cocoa? What should I do: wait for Cocoa to introduce a ...

Tools to create the file necessary to integrate an application with AppleScript

Are there any tools that allow to create the necessary files required to add the support for AppleScript in an application? I am looking for a tool that simplifies the task, possibility one that requires me to just give a description of the involved classes. ...

Frameworks to use to build applications handling text

What are the tird-party frameworks that are more useful to create a generic application? I am looking for a framework that is well documented, and that would allow me to not write from zero a set of classes that every applications should have. There are some frameworks made available free from some software houses, but the documentation ...

How to compress data using zlib

Is there a class that allows to compress data with zlib, or the only possibility is to use directly zlib.dylib? ...

Differences between objective-c vs objective-c 2.0

question says it all. (I reserved 2 library books which came on the same day. I saw them on the shelf and realized that they were the same except one was ObjC and one was ObjC 2.0. (not full titles...) Bonus, what is Objective C++? objectie ...

Objective-C 2.0 dot notation - Class methods?

Please note I am specifically referring to the fact that dot notation is being used on class methods, not instance methods. Out of curiosity, I wanted to see what would happen if I tried to use Objective-C 2.0 dot notation syntax on a class method. My experiment was as follows: #import <Foundation/Foundation.h> static int _value = 8; ...

Hiding a Mac application from the dock

I am trying to create an application with the only purpose to implement a Applescript dictionary, and extend Applescript. I have read of faceless applications (agents), but my application allows Applescript scripts to show some dialog boxes. What can I do to avoid my application icon appears in the dock when it is invoked by Applescript?...

What is wrong with my do/while loop?

the following code gives me an error of: "expected ';' before '{' token". can anyone see why? do { r = rand() % numElements; } while ([questionsShown containsObject:r] && myCount < numElements) { //code here… } ...

Objective-C: Reference class without init.

Normally if I had Class 1 and I wanted to use it elsewhere, I would write Class1 *class1 = [[Class1 alloc] init]; to create a new instance. But what if I needed to reference variables in Class1 in another class and did not want to create a new instance, but use an existing one. How would I do that? If I call init, and create a new instan...