cocoa

NSDate from NSString

I have a string in the format "Fri Jul 09 17:57:44 +0000 2010" which I need to convert to an NSDate. I have tried a few unsuccessful operations to convert this date, and was wondering if anyone could tell me how I can achieve this. Regards ...

Observe other application quit or sudden termination in cocoa app

I need to create wrapper around application, so I created little cocoa app that opens application with [[NSWorkspace sharedWorkspace] launchApplication:…], can I register some event when that application quits or terminates (I certainly need to get event if app is finished good or bad way). I know that I can ask if such application is ru...

Handling menu events in cocoa

Hi, How to handle the menu bar events, that is if i press "quit" or "about" option in the menu bar where the control comes. Thanks in advance, ...

Working with a file by pathname/URI using Finder + ScriptingBridge

I'm using the generated Finder.h headers from the sdef utility, and it appears that a lot of Finder SB methods require objects of type FinderItem to do anything meaningful with. How would I go about creating one of them objects based on a path to or URI of the file? The farthest I've got is the [SBObject initWithProperties] method bri...

How to control external monitor output using cocoa?

Hi all, I am making a sample application in cocoa in which I have to control video output being send to external monitor connected to a macbook using Mini Display Port/ Mini DVI. Can anyone suggest me how can I implement it in cocoa? Thanks in advance for any link, suggestion. Miraaj ...

is [_internal lock] in synthesized accessors the same as @synchronized(self)?

It's fairly well documented that @synthesize atomic settings/getters are implemented with "something" like so: { [_internal lock]; // lock using an object-level lock id result = [[value retain] autorelease]; [_internal unlock]; return result; } The situation I have, I want to access two properties atomically (ie. not u...

GraphKit framework in Cocoa

Hi all, I try to draw an XY graph using GraphKit. Information of this framework is very limited on the internet... Here's what I did: // a xychart is predefined in header as GRChart GRDateSet *dataset = [[GRXYDataSet alloc] initWithOwnerChart:xychart]; [xychart addDataSet:dataSet loadData:YES]; [xychart reloaddata]; also I imple...

iTunes Song Title Scrolling in Cocoa

I have searched extensively and cannot for the life of me find any information about how to achieve a similar effect to that of the iTunes song title scrolling if the text is too large in Cocoa. I have tried setting the bounds on a NSTextField to no avail. I have tried using NSTextView as well as various attempts at using NSScrollView. ...

How to synthesize getter and setter for C-array on obj-c

I have an ObjC object defined as follows @interface Fruit : NSObject { int fruitsinbranch[4]; } @property (readonly) int fruitsinbranch[4]; @end And then in the implementations I have the usual @synthesize fruitsinbranch[4]; It does not work. What's the right way of doing it? (And no, I am not asking for other ways to do stuff...

Debugging Tools/Method for Mac OS X Interface Builder (3.2.3)

I am new to Mac OS X programming and so I am going through an introductory text that includes building interfaces using Interface Builder (3.2.3) for both Cocoa and Carbon. Unfortunately I am having problems getting some of the examples I type in to run error free in the Cocoa and Carbon simulators. So I tried downloading the source co...

which widget in the Inspector view of Interface Builder?

I want to use a widget just like size or attributes buttons of Inspector view of Interface Builder, but I found in Library view , no one widget will be found? which widget it used?Thank you very much! ...

Placing paragraphs within text fields or labels

How do I place a small paragraph within a text field or label? Do I use code for the new line? I'm using Interface Builder with Xcode. ...

Converting Object to XML Cocoa

I am looking for a tutorial, description, or something that could point me in the right direction for converting an object to an XML soap request in Cocoa. Specifically I am using this to hit a .NET webservice. I do at this point have my code working but it feels like cheating and bad chi. My XMl request is basically lots of: Reques...

How to add a checkbox in front of folder tree in finder with Mac?

I want to change a outline view , and add checkbox cell in front of node , and the node have a icon and how to add checkbox in head of the icon? ...

WebKit WebScripting Protocall callbacks with multiple parameters?

Hey I've registered my object and function selector to get callbacks from javascript when the function is fired. This all works fine for functions with a single parameter, how can I receive callbacks for functions with multiple parameters? So far keeping the syntax the same gets my function to fire, however the object passed in is alwa...

Add to the "Open Recent" menu an item that doesn't point to a file

Is there a way to add an item that doesn't point to a file that exists on the file system to the "Open Recent" menu? In an application not based on NSDocument, I can add an item to the "Open Recent" submenu with the following code: [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL URLWithString:stringToFi...

Set Focus to a Cocoa Window in Carbon App

Hello, I'm trying to create a Cocoa Window within an otherwise Carbon Application (it's an OpenGL API that uses AGL. Can't change it so don't comment on that). Here's a code snippit: WindowRef winref = static_cast<eq::AGLWindow*>(getOSWindow())->getCarbonWindow(); vc = [[SFAttachedViewController alloc] initWithConfig:config]; //load...

ShortcutRecorder record CMD+Tab

I'm trying to allow ShortcutRecorder to record CMD+Tab. The problem is that, even if ShortcutRecorder has the focus, if I press CMD+Tab, the application switcher appears. Is there any way of allowing ShortcutRecorder to "intercept" the CMD+Tab? Thanks! ...

opencv matrix (cv::Mat) from NSImage

This is not really a question but since I didn't find any information on such a transformation and because the transformation is not as trivial as it seems, I thought I'd post some code here. The code is part of http://rubyk.org (BSD licence) so feel free to reuse. Is there anything wrong with this code, or do you have a better alterna...

How to know menu items( about or quit) clicked

I am using notification to get control when menu items clicked... - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuChangedItem:) name:NSMenuWillSendActionNotification object:nil]; } -(void) menuChangedItem :(NSNotification *)inSend...