appkit

11415 compile errors FTW?!

Hello. This is something I've really never seen but, I downloaded the source code of the sine wave example at http://www.audiosynth.com/sinewavedemo.html . It is in an old Project Builder Project format, and I want to compile it with Xcode (GCC). However, Xcode gives me 11415 compile errors. The first few are (all in the precompilation ...

Aaron Hillegass Chapter 18 Challenge Question

I am working through Aaron Hillegass' Cocoa Programming for Mac OS X and am doing the challenge for Chapter 18. Basically, the challenge is to write an app that can draw ovals using your mouse, and then additionally, add saving/loading and undo support. I'm trying to think of a good class design for this app that follows MVC. Here's what...

NSArray objectAtIndex is not working. Please help

NSArray* address = [NSArray arrayWithArray:[detailItem addressArray]]; NSLog(@"address = %@", address); NSString* addressToString = @""; int arrayCount = [address count]; for (int i = 0; i < arrayCount; i++) { addressToString = [addressToString stringByAppendingString:[address objectAtIndex:i]]; if (i == arrayCount -1) { ...

Tracing/finding function calls and arguments made by an AppKit class method

Suppose I'm calling class method + (NSStatusBar *)systemStatusBar: NSStatusBar *sB; sB=[NSStatusBar systemStatusBar]; My question is what's the best way to trace that class method call and find out what it is calling in terms of other methods and arguments? Does this entail advanced disassembly beyond what XCode provides? Thanks ...

popup menu calling for update of all menus on each keypress

I'm creating a pop up menu programmatically and updating it with the delegate method menuNeedsUpdate:(NSMenu *) menu and then displaying it using the popUpMenuPositioningItem:nil atLocation:mouseLoc inView:nil method. It works fine as far as mouse control is concerned. However, when using the keyboard (letters or arrow keys), I've notic...

Decoding integer and other masks in Cocoa

Cocoa has a plethora of integer masks and codes. For instance, NSCommandKeyMask or NSF1FunctionKey, which are clearly defined and documented in the headers. However, some can be archaic and when accessing accessibility attributes, for instance to get the glyph (AXMenuItemCmdGlyph), you're given an integer number like 111, which represen...

Updating NSDocument status without undo?

I have a document-based application but I am not using undo. How do I change the status of my window to be 'dirty' and certain times? Thanks. ...

Adding yourself as an observer to an array than an NSArrayController is bound to?

I have class called AppController which contains a mutable array of Person objects called people. Each person simply has an NSString and a float. I also have an NSArrayController whose contentArray is bound to the people array in AppController. Then I have the usual setup of a table view bound to the array controller to show a list of ...

How to successfully import Appkit Framework in iPhone?

Hi, I would to use the NSSpeechRecognition but this Appkit Framework was not available in iPhone os frameworks. This is available in systems/library/frameworks/Appkit.framework. Is there other way to make use of AppKit for NSSpeechRecognitio in iPhone? Thank you. ZaldzBugz ...

NSTextView inside an NSScrollView doesn't scroll :(

I have the following code in a stand-alone Cocoa test app: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSView *contentView = [window contentView]; NSTextStorage *textStorage = [NSTextStorage new]; NSLayoutManager *layoutManager = [NSLayoutManager new]; NSTextContainer *textContainer = [NSText...

how to keep track of webpage opened

Hi, Just wondering if there's a way to keep track of what website the user is browsing to via Cocoa or Webkit? Sort of like the TrackTime.app? Thanks ...

Reset Spinning Progress Indicator

A simple question here for many of you. I have an indeterminate NSProgressIndicator which I start and stop many times in my code. Does it reset when you call restart it, or do you have to manually do that? If you do have to do it manually, how would I go about doing it? Many thanks, jrtc27 ...

NSButton Mousedown event

Hi, I'm trying to show a pop up menu on mouse down on a button. The button should appear pressed while mouse down, and be "un pressed" on mouse up regardless of any of the menu item been selected. Similar to the Expose/Space Preference panel "+" button for adding application. So far I tried 3 methods: Sent action when button is clic...

NSPopUpButton revert to initial state

Hi, I register for notification NSPopUpButtonWillPopUpNotification in order to change the pop up menu before it is shown. The new pop up menu consist of running Application list with respected icons. When the application is selected, it calls a @selector method. After selection completes, the button have the image of the selected appl...

Resizing NSTokenField after populating with tokens

I am using an NSTokenField as a way for users to enter tags. Everything works fine and it hooks up with CoreData managing the tags both when the user adds or deletes a tag. I recently added logic so that the NSTokenField would resize vertically as the user adds tags and they break to the next line using Andrew Bowman's IFVerticallyExpan...

Does NSXMLNode's nodesForXPath:error: guarantee a specific ordering?

I extract nodes from an XML document by calling -nodesForXPath:error:. Now i wonder if it guarantees, that the nodes are returned in the same order as they appear from top to bottom in the document (it's crucial in my case). My XML looks something like this and i retrieve the b tags with the XPath query: <a> <b> ... </b...

Cocoa app handling a standard HTTP url scheme

I need to handle HTTP URLs that begin with a certain domain with my app, because it points to a REST source. The web service however is not under my control, so i can't easily introduce a custom url scheme to open the links with my app. Is there a way to intercept and handle such URLs in a Cocoa app? Example: http://static.domain.name/...

Change Window Button's Control Tint

I'd like to override the default system control tint for my app to be always NSGraphiteControlTint. The following code doesn't seem to work though. Any suggestions? NSButton *button = [window standardWindowButton:NSWindowCloseButton]; [[button cell] setControlTint:NSGraphiteControlTint]; Regards, Erik ...

Getting the album artwork, song name, album name and artist name from an audio file.

How can I get album artwork, song name, album name and artist name from an audio file? I need to display this without the use of iTunes. Thanks. ...

How to know which NSTableView opened a Contextual Menu?

Hi!, I have 5 NSTableView's instances that have the same contextual menu. When I get the message that the menu has been clicked I need to know which table sent it. I've checked the NSMenu documentation but I don't seem to find a way to check which of the tables opened the menu.. I'm thinking of subclassing NSTableView and send a message...