cocoa

Seeking a multiple text field Cocoa control like in Address Book

I'm looking to make a view similar to Addreess Book in editing mode, where there are fields arranged in a table, only the selected one showing a border, and with the plus and minus buttons to add/remove rows. Anyone know if there's an open source implementation of such a control, before i go and roll my own? ...

Control iTunes from a cocoa application

I am developing a mac application that involves audio playback. I would like to pause other audio players when our playback starts. how can I 1) detect that itunes is running 2) detect that itunes is currently playing 3) pause itunes 4) resume itunes when I am done also: 5) Is the a way to pause other types of media playback as well? ...

Adding item to NSMutableArray with function results in no

I have the following utility method declared, where "players" is a NSMutableArray object and a property of my application's view controller. My problem is that "players" still has 0 objects after this method is called. -(void)addPlayerNamed:(NSString *)name withLife:(NSNumber *)life{ NSMutableDictionary *newPlayer = [NSMutableDiction...

Detecting proximity of two object in the same NSView

I am working on a drawing program and am trying to figure out the best way to imitate the 'magnet' behavior found in applications such as Omnigraffle. The idea is: as a line is drawn between two objects (visual objects on screen, not OOP objects), as the line from the first object approaches the second, a 'magnet' or 'node' on the seco...

NSPathControl get the dragging destination

I have a NSPathControl at the top of my application and a tableview at the center. Now I would like to drag an entry from the tableview to the NSPathoControl and get the destination NSPathComponentCell from the NSPathControl. I've implemented the neccessary messages for the NSPathControlDelegate Protocol. The dragging from the tableview ...

Converting an NSString to an NSInteger

if i have: NSString* number = @"2000"; Will NSInteger integerNumber = [number integerValue]; be equal to the integer representation of 2000? ...

Anyone know what program the Apple store demos likely use to make their interactive desktop....

I have a project that I am attempting to do and we want something similar to what the Apple store does. We thought it was a Quartz Composer interactive desktop but I've been putting together an xcode cocoa solution to do it too. Here is an image of what I'm wondering about it is just a Title and 3 images that link out to url locations. ...

Cocoa NSPanel Question

Hey all, quick question that has been bugging me about NSPanel. I like the look of The NSPanel HUD but for the project I am doing I need the Panel to not be moved. Does anyone know of any possible solutions to make it were my NSPanel cannot be moved at all but maintain its buttons interactivity? I've been searching for any questions simi...

Passing array of custom objects to NSCell in NSMatrix programatically

I have an NSArray of custom NSObjects. Each object has some properties and an image that I would like to display in a grid view. NSMatrix appears to be a good solution to my problem, but I am having issues getting the content of the objects to display. Couple of things to note. I am not using core data I am trying to do this programm...

psd Image creation with layer properties using CGImageRef

Hi, Working in Mac OSX, Cocoa I have an psd image with layered property. I want to crop it to the crop rect and save this cropped image with the settings of original image. I am using CGImageRef for all the image related operations. I have enclosed the code i used to crop the image is given below. But it fails to create the layered i...

iPad application download files from password-protected directory

Hello everyone, I have a password-protected directory on a running server. I would like to download some file(s) from this directory (using a URL) to the Documents directory of my iPad application. How do I send the password of the directory I am trying to access? ...

How to implement google notifiers like alerts

Hi all, I am very fond of this feature of google notifiers: If a new mail comes in gmail, it shows its alert on a semi-transparent borderless window on top right side of my mac, which fads away after some time. Can anyone suggest me how can I show alert messages with similar appearance and animation in a sample application? Thanks, ...

How to set a Finder-window background image on a disk image volume

Hi all, Generally to distribute a simple cocoa application we make dmg of its release folder. When we double click on it, it mounts its image and displays an un-editable window with .app and/or other files, such dSYM, contained within it. Right now the un-editable window appears with white background and icons of files within it. My re...

Writing a simple app to convert files to pdf

I want to create an application on a Mac to convert multiple files (txt, pdf, doc, html, etc) to a single pdf file that can be printed. The real point is that if you have 50 texts you don't have to open every single file and click command-p. I'm not quite sure whether the best way to do this is by creating a full-fledged app or an autom...

Open source for reading and writing multi layer .psd image.

Hi All, I am in Mac OSX, Cocoa . I want to read and write multi layered .psd images. With Cocoa native api's i can read or write the images as flat images.(i.e., single layered) So is there any 3rd party library available to perform the operations? This is my earlier query. http://stackoverflow.com/questions/3456560/psd-image-creati...

NSUserDefaults & bindings.

Hi, How can I synchronize two interface elements and have the value saved at termination? I connected a checkbox' state and a text field's enabled to an NSObjectController. The "content" outlet is connected to the checkbox too. (Not sure why?). It works with the NSObjectController but whenever I bind the value's to an NSUserDefaultsCont...

How can i receive Notifications while a modal dialog is open.

I need to send messages to the GUI thread which should be processed the next time the GUI thread is idle. This message can come from the GUI thread or background threads. I tried a combination of a MachPort/Notification. But when i do a [[NSNotificationQueue defaultQueue] enqueueNotification: my_notify postingStyle: NSPostASAP]; Thi...

How to store a typedef enum in CoreData

I have a typedef enum I use to represent a state of a job in a queueing system and it is defined as typedef enum { kTWjobStateRunning, kTWjobStateQueued, kTWjobStateError }TWjobState; Everything is fine, but now I would like to store it as an attribute in CoreData. My first idea is that an enum is basically an integer, so would wrapp...

Save NSTextView in NSMutableArray and read it

Hi Everyone! My question is the following, I have an NSTextView and I want to do 2 things : First save this textview in an NSMutableArray and assign a X,Y position to it in this array. Secondly, get this textview from the NSMutableArray and display it at the position I've set when I saved it in the array. Anyone have an idea of ho...

NSView background image composed of 3 different files.

Hi, I'm trying to set a background image of an NSView. (Actually an NSScrollView.) At the moment I'm subclassing drawRect: and I'm using NSDrawThreePartImage to draw the image but there are a few things that are not correct whenever I start scrolling. Here's an image. Are there better ways to draw the images? - (void)drawRect: (NSRect)...