cocoa

Attaching user data to AXObserver

I am using an AXObserver to monitor when a window is closed. In the callback, I am just raising an NSNotification. All working well. What is the correct syntax for attaching some user data as refcon? The working call looks like this: err6 = AXObserverAddNotification(observerTable, tableRef, kAXUIElementDestroyedNotification, nil); ...

How to show file thumbnails?

Hello everybody, I got a TableView with a list of files in a directory. Now i want to add a colum with the file-thumbnails. How do i do this? ...

Retrieving current mouse coordinates and manipulating them in Mac OS X using Cocoa?

Is there any way to get the coordinates of the mouse in Mac OS X? And further could you somehow manipulate the current mouse location using that method to retrieve the coordinates? Or would you have to use something else to move the cursor? ...

In Cocoa, why won't a textfield be shown until after the IBAction is completely executed?

I have an IBAction with some simple code inside: -(IBAction)change:(id)sender { [textfield setHidden:NO]; [self dolengthyaction]; } 'textfield' is an NSTextField in a nib file, and -'dolengthyaction' is a function that takes about a minute to finish executing. My question is: Why isn't the textfield shown until AFTER "dolengt...

Cocoa class not displaying data in NSWindow

I have one class that controls one window, and another class that controls a different window in the same xib, however, the second window never displays what it should. In the first class I alloc and init the second class, then pass some information to it. In the second class it displays that data in the table view. Yes, in the .xib I ...

Observing model changes with Cocoa Bindings and NSArrayController

I've got an NSArrayController bound to a mutable array in my controller, which manages an array of my model objects. The array controller is bound to my UI. It works well. Now I'm trying to manually observe when a value changes in my model in my controller class (basically I'm marking the changed model as "needsToSave" for later on, but...

LSUIElement not working

I have an application that has LSUIElement = 1 in the Info.plist. When I run the application, a dock item and toplevel menu bar is created for it. Why? EDIT: I was using a library that was calling TransformProcessType(), clobbering my Info.plist configuration. ...

Objective-C why doesn't my array of array works?

This is probably a completely stupid question, but i'm pretty new at objective-C and programing in general. i'm trying to make an array of arrays but can't manage to make it work : @interface ArraysAndDicts : NSObject { NSMutableArray * mySimpleArray; NSMutableArray * myComplicatedArray; } the implementation : -(void)generateValueF...

How to force Mac window to foreground?

How can I programmatically force a mac window to be the front window? I have the window handle, and want to ensure that my window is displayed above all other windows. I can use both Carbon & Cocoa for this. ...

How can I bind NSButtonCells title to a controllers arrangedObject?

Hello, I have an OutlineView with one column of NSButtonCell checkboxes. The content binding of the outline view is to a TreeController. Currently, I can bind the checkbox status to the content of the TreeController by binding the value of the Table Column to TreeController.arrangedObjects.shouldBeCopied. However, I can only seem to bin...

NSOutlineView not redrawing

Hello, I have an NSOutlineView with checkboxes. I have the checkbox state bound to a node item with the key shouldBeCopied. In the node item I have the getters and setters like so: -(BOOL)shouldBeCopied { if([[self parent] shouldBeCopied]) return YES; return shouldBeCopied; } -(void)setShouldBeCopied:(BOOL)value { ...

Cocoa : Scale Image dragged into an ImageWell

I am working on application to keep a comic book collection in order. The user should be able to drag an image of the cover artwork into the program via an ImageWell. Since it is not possible to drag the image out of the application again I don't need to save the picture in it's original size. An image at the size of the ImageWell would...

problem with pathForResource

HI all I have problem with NSString *filePaht = [[NSBundle mainBundle] pathForResource:(NSString *)name ofType:(NSString *)ext]; if I used NSString *filePaht = [[NSBundle mainBundle] pathForResource:@"soundName" ofType:@"aiff"]; it's OK but when I used NSString *fileName = [[file.list objectAtIndex:index] objectForKey:@"soundName"]; N...

Duplicate conflicting frameworks in cocoa plug-ins

I am currently writing a plug-in framework for my application. I would like to be able to release plugins without having to update my application, and I intend on making the framework available for third party plugins. I am currently running into issues when two plugins ship with identical frameworks. When the plugins are loaded the runt...

set Image to Button

Hello all, Could somebody help me a little bit with my issue below? When I call the myFunction, images which I want to set to buttons appear after 2 sec simultaneously, not one by one with delay of 0.5 sec. More info: generatedNumbers is array with four elements of NSNumber (4,1,3,2) buttons are set in UIView via IB and are tagged...

Using NSWindow or NSPanel as "CardLayout"

How guys. I'm not top dev in java, but what I`m really not is cocoa top dev :P I would like to have your assistance to produce a layout with cocoa and IB to work just like the CardLayout in Java. Do you have some idea of how to do it? Thanks for the attention! EDIT: CardLayout: A set of panels ("cards") are designed to compose a "deck...

How to select one NSCell in an NSTableView?

I have a small NSTableView with a checkbox. Whenever the checkbox is not checked, I want one of the adjacent NSCells to be grayed out and inaccessible. However, I can't figure out how to address only one specific cell. -dataCellForRow of NSTableColumn always changes the template cell for the whole table column. How can I access one sin...

How to quickly search an array of objects in Objective-C

Is there a way in Objective-C to search an array of objects by the contained object's properties if the properties are of type string? For instance, I have an NSArray of Person objects. Person has two properties, NSString *firstName and NSString *lastName. What's the best way to search through the array to find everyone who matches 'Ke...

Comparing an [NSURL path] to an NSString doesn't work

I have this code: NSLog([url path]); if([url path] == @"/connect/login_success.html") { NSLog("IT WORKZ"); } When I run my application, do the login etc... my console says: 2010-05-04 23:49:57.297 Framebook Test Application[8069:a0f] /connect/login_success.html But it should also print IT WORKZ to the console, which it does not...

NSArray filled with bool objects

I have an NSArray filled with bools (expressed as a number), and I need to test to see if any object within the array is equal to 1. How can I do it? ...