cocoa

Can AppleScript Do This?

I need to be able to send text from the clipboard to an application I'm writing (in Objective-C) via AppleScript. Obviously I need to make my application scriptable (I'm currently reading the Apple Docs about this) but is this possible/easy-to-implement? ...

How do you keep Cocoa controllers from getting too big?

Hello! Do you have some tricks or techniques to break Cocoa controller classes into smaller chunks? I find that whatever I do the controllers end up being one of the more complicated classes in my design. The basic stuff is simple, but once I have several pop-overs or action sheets running, things get uncomfortably complex. It's not that...

iPhone app launch times and Core Data migration

I have a Core Data application which I plan to update with a new schema. The lightweight migration seems to work, but it takes time proportional to the amount of data in the database. This occurs in the didFinishLaunchingWithOptions phase of the app. I want to avoid <app> failed to launch in time problems, so I assume I cannot keep the ...

Strange behaviour of NSString in NSView

Trying to create a Skat-Game, I encountered the following problem: isBidding is a Boolean value indicationg, the program is in a certain state, [desk selected] is a method calling returning the current selected player, chatStrings consists of dictionaries, saving strings with the player, who typed, and what he typed - (void)drawRect:(N...

Layering Cocoa WebView - Drawing on top?

http://stackoverflow.com/questions/1618498/webview-in-core-animation-layer The only other thread I can find is the above which doesn't necessarily fit my needs. Is there a reliable way to simply draw a view on top of a webview? I've tried to layer a regular NSView on top of WebView, and it draws right at first, but any movement in the w...

Creating a window from a menu item

I would like three menu items on the menubar with the keyboard shortcuts cmd-1, cmd-2, cmd-3. This I know how to do. Each menu item would open up a different window (win1, win2, win3). I want it so that only one instance of each window is permitted to be open at any one time (i.e. only one win1, one win2, etc). How is this best approa...

How do I set the text color of a Cocoa tooltip?

I am using BGHUDAppKit for an outline view within a HUD-style (black) NSPanel. As such the text in my outline view cells is light gray or white. Unfortunately this means that when I hover to bring up a tooltip for a cell's value, it shows up as light gray text on yellow, which is illegible. How can I set the text color for the toolt...

Core Data Image Won't Load Into NSTableView Image Cell

In my code I am storing an image into my Core Data model (works fine). If I set up my view to have an NSImageView and bind its Data to Controller Key: selection and modelKeyPath: myImagePath, it works. It will show each image for the selected row. I then create a new column in my NSTableView and drag an image cell onto the column. Howev...

Is NSXMLParser's parse method asynchronous

Is NSXMLParser's parse method asynchronous? in other words if i have an NSXMLParse object and i call [someParseObject parse] from the main thread, will it block the main thread while it does it's thing? -Thanks for answering this seemingly noob question. -Ben ...

how to display data in NSoutlineview?

I am new in cocoa framework.I want to disply data in NSOutlineView (static data).But i dont know how to use.Please advice me ...

how to check download resumed or not in ASIHTTPRequest..?

hi i am downloading file from server using ASIHTTPRequest in my iphone application but i am not getting any callbacks to know whether downloading resumed after i stopped and resume it again . ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request setAllowResumeForFileDownloads:YES]; [reques...

COCOA Objective-c : How can connect to mysql database?

I am creating application for MAC using cocoa framework, I would like to know how and what are the ways i can connect to MySql database using cocoa framework. ...

Why can't I use "List" as class name of a subclass of UITableViewController?

Why can't I use "List" as class name of a subclass of UITableViewController? ...

How to avoid superclass methods getting overridden by sub class in objective - c

Like in java: A final class cannot be subclassed. This is done for reasons of security and efficiency. Accordingly, many of the Java standard library classes are final, for example java.lang.System and java.lang.String. All methods in a final class are implicitly final. How can I achieve this behavior in objective-c? ...

Objective C - Constants with behaviour

Hi, I'm new to Objective C. I am trying to define Constants which have behavior associated with them. So far I have done - @interface Direction : NSObject { NSString *displayName; } -(id)initWithDisplayName:(NSString *)aName; -(id)left; // returns West when North -(id)right; // return East when North @end @implementation Dire...

Make NSFormatter validate NSTextFieldCell continuously

In Cocoa, I have an NSOutlineView where the cells are NSTextFieldCell. The cell displays values which are strings that are formatted according to certain rules (such as floats or pairs of floats with a space in between). I have made a custom NSFormatter to validate the text, and this seems to work with no problem. However, the cell (or ...

Face Detection API for Objective-C

Hello, everybody. Does someone here knows a face detection API for Objective-C? I just want to detect one or more faces inside a photo, so it's not necessary face recognition. I want to build something similar to the iPhoto's feature that puts a square on all faces in a photo. It would be nice if the API can be used on iPhone apps to...

How to display sheet contained by different NIB with separate sheetController

I need to open sheet from separate NIB and wants to use its separate controller awakeFromNib to configure sheet controls.Please let me know the best way to do that.I am using 10.5 API with XCODE 3.1.4 ...

How to best share an NSMenu between multiple NSPopUpButton instances

Hi, I need to share the same NSMenu instance between multiple popup buttons. When I create an NSPopUpButton in IB, a new menu is automatically created and inserted as a child of the NSPopUpButtonCell. At the moment, I simply create an IBOutlet NSMenuItem* standardMenu member in my MainController and connect the "menu" outlets of the p...

[Cocoa] NSImage transparency

I'm trying to set a custom drag icon for use in an NSTableView. Everything seems to work but I've run into a problem due to my inexperience with Quartz. - (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent *)dragEvent offset:(NSPointPointer)dragImageOffset { NSImage *dragIm...