cocoa

NSAffineTransforms not being used?

I have a subclass of NSView, and in that I'm drawing an NSImage. I'm unsing NSAffineTransforms to rotate, translate and scale the image. Most of it works fine. However, sometimes, the transforms just don't seem to get activated. For example, when I resize the window, the rotate transform doesn't happen. When I zoom in on the image, ...

How to customize NSTextField look (Font used, font size) in Cocoa ?

Hello everybody, I'm making a Cocoa application and I can't figure out how to do something. I want to make an NSTextField with a custom look like the one in Wallet : Wallet screenshot. I figured out how to change the NSTextField size but I don't know how to change the font and it size. I subclassed NSTextFieldCell like this but it ...

How do I secure a per user GUI launchd agent against a non admin user disabling it?

I have a pair of launchd daemons, one of which is a true daemon (runs as root) and one of which is a GUI agent that runs as a per GUI session basis (session type Aqua). I need to prevent non admin level users from disabling the user level agent using launchctl, or at the very least figure out how to reload the agent from the root level ...

Be Alerted When SystemUIServer Restarts

Hi, I need to be able to be alerted either when SystemUIServer terminates, or when it launches, preferably terminates. The notification NSWorkspaceDidTerminateApplicationNotification isn't posted when launchd restarts it. Is there some way I can be alerted? --firen ...

Input Manager in Cocoa?

Basically, I want to execute a method from my app whenever something else from another app happens. I know the name of the method from the other app, I just don't know how to make my app do something in response to it. Is an input manager the best solution? ...

Interface Builder UIDatePicker

is there a way to set the UIDatepicker to minute and seconds versus Hour and Minute edit I ended up adding my own UIPicker class, and creating the value and label myself. ...

Find Installed applications in cocoa

Hi, I am developing an application in cocoa.I need to check whether iTunes is installed or not in the machine.Is there any way to find the installed applications???? ...

How to play a mp3 file from within the Resources folder of my application ?

I am making an app that will play sound on events but I can't figure out how to access files from the ressources folder of the Application. Here is what I'm doing : NSSound *player = [[NSSound alloc] initWithContentsOfFile:@"Sound.mp3"] byReference:NO]; [player play]; But it's not working at all. If I put a full length path it wil...

How can I find out if an object implements a particular method?

I am iterating through an NSArray that contains many different types of objects. There are many methods to figure out what class the object is. However, I haven't been able to find a good way to find out if an object can implement a particular function. I can put it in a try-catch but it will still output an error message in the console ...

HTML character decoding in Objective-C / Cocoa Touch

First of all, I found this: http://stackoverflow.com/questions/659602/objective-c-html-escape-unescape, but it doesn't work for me. My encoded characters (come from a RSS feed, btw) look like this: & I searched all over the net and found related discussions, but no fix for my particular encoding, I think they are called hexadecima...

Objective C - Making UILabel update as user types text in UITextField

How would I make a UILabel update as a user enters text in a UITextField. In my case, I have a quadratic equation solver for the iPhone and as the user enters the values of a b & c, I want a UILabel to update with the numbers given by the user. ...

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 is there a calendar that already has Monday as the first day of the week, instead of Sunday. I'm currently working on an app that is based around a week's worth of work, and it needs to start on Monday, not Sunday. I can most likely do some work to w...

How do I set the fill character for displaying numbers (Objective C)

I'm trying to format a string to give me 2 characters for a number, no matter what its value. Right now, I have [NSString stringWithFormat:@"%2d:%2d:%2d",h,m,s)]; and for the values 1, 2, 3, the output is 1: 2: 3 How do I change the spaces to 0's ? ...

How to implement a Cocoa-based Adobe Photoshop plugin

Cocoa used to work on CS3 with the trick of putting a Cocoa bundle inside the main Carbon plugin bundle, loading it from Carbon and issuing a NSApplicationLoad(). That's because Photoshop CS3 was Carbon-only and used to unload the plugin bundles. Photoshop CS4 uses Cocoa and has its own NSAutorelease pool in place on the main thread. ...

NSString color

Hi, I am developing an application in cocoa I need to append a colored text to another text in table view,Is there a any way to do this ??? ...

Reference from UITableViewCell to parent UITableView?

Is there any way to access the UITableView from within a UITableViewCell? (if the cell belongs to that tableView? ...

Crash Reporter for Cocoa app

I'm working on a Cocoa app targeting Leopard and above, and I'm thinking about adding a crash reporter to it (I'd like to think my app won't crash, but let's get real here). I have some mostly conceptual questions before I really get started. 1) How does this work conceptually, knowing when there's a crash and bringing up a reporter? Do...

Implementing -hash / -isEqual: / -isEqualTo...: for Objective-C collections

Note: The following SO questions are related, but neither they nor the linked resources seem to fully answer my questions, particularly in relation to implementing equality tests for collections of objects. Best practices for overriding -isEqual: and -hash Techniques for implementing -hash on mutable Cocoa objects Background NSObj...

Can't figure out where memory leak comes from.

Hello everyone! I'm somewhat of a cocoa newbie and I simply can't figure out why I'm getting a spike in the leaks graph in Instruments with this code. It seems to be a small leak (i.e. 16 Bytes and the Leaked Object is "Generalblock-16"; that is the only leaking object and says Self 100%) and it seems to remain that size regardless of wh...

Why does my program crash when accessing a property with self. and a synthesized accessor?

I have data object class: @interface Item: NSObject { NSString *title; NSString *text; } @property (copy) NSString *title; @property (copy) NSString *text; @end @implementation Item @synthesize text; - (void)updateText { self.text=@"new text"; } - (NSString *)title { return title; } - (void)setTitle:(NSString *)aS...