cocoa

NSArrayController -(selected object)-> NSUserDefaults

I have created a preference pane that allows the user to select a QTCaptureDevice. In Interface Builder, I bind a KVC-compliant method in my model class that retrieves an NSArray of QTCaptureDevices to an NSArrayController, which is in turn bound to an NSPopupButton. This all works; the list of QTCaptureDevices appears in my NSPopupBut...

Crashes in snow leopard, not leopard

Hi, I have an application called Flick Background (I'm the developer). It works fine on Leopard, but doesn't work on Snow Leopard (crashes when downloading an image). Here is the crash log (some is removed, because it contains personal information): Process: Flick Background [8591] Path: <<hidden>> Identifier: ...

NOOB Problems with getting results from code (more specificly with NSComboBox)

I know that this is probably a simple question but here is what I'm racking my brain to figure this out: I know that this: - (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index { return [midiModelContents objectAtIndex:index]; } will return the item at the index provided. My question is, what code do I n...

How to add a socket as QTCaptureOutputs for a QTCaptureSession

I'm reading Apple's documentation on using QTKit to capture streaming audio and video from input sources. I read that the central class QTCaptureSession handles the input and sends it to every possible output (QTCaptureOutput). The documentation lists six subclasses of QTCaptureOutput (e.g., QTCaptureMovieFileOutput). I would like to cr...

Rendering text animations into a video file in Cocoa

Hello Everyone, I am after the following functionality in an app I am scoping. A user has the option to enter some set of text that will be overlaid onto a video file as animated text. In other words, the application is bundled with a stock version of the video containing no text, and the custom text entered by the user is used to rende...

How to grab an image of an offscreen NSWindow?

I'm trying to get an image of an offscreen window to use in a CALayer-based animation, but no matter which method I try I cannot get an image out the other side. Here is the code I've been using on a custom NSWindow subclass in my project: CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, ...

NSPopUpButton with custom images

I want a popupbutton with only a custom image (type pulldown, no title, no arrows) that change the image when the user click on it. I first tried to do it in IB setting the bezel to square and resizing the popupButton the same size of the image. But the image doesn´t appears completely (there is a "margin" at the left and right sides). ...

Memory management for a Cocoa class without an owner

I have a Objective-C class that makes an HTTP request and, after receiving a response, calls methods on its delegate. The class provides some convenience methods around the built-in NSURLRequest for my application. My question is: how do I ensure that I release this object? Normally, an object's owner is responsible for ensuring that a...

Interface Builder Plugin Image inspector property problem on load

Hi. i have created a custom NSView that displays an image. i have created a property in Inspector view with binding to File's Owner. Everything works fine in runtime image changing. But nothing is loaded when i save and load xib file. here is the simplified code: IBDocument *document = [IBDocument documentForObject:self]; [self->defau...

[Objective C: "Bindings"] How can I bind an NSTableView with 2D data at the backend ?

Hello there, I am new to mac, and I am in trouble. I need to bind NSTableView to 2D data at the back end so that I can have dynamic update of data at the front end. I have 5*10 data at the back end that I want to bind it to NSTableView. I have tried almost every approach, read every article, implemented examples from the internet but it ...

Create NSWindow from worker thread crash?

The Thread Safety Summary on developer.apple.com states that NSWindow's are thread safe* and can be created from worker threads. I have a worker thread that i've created rather simply: [NSThread detachNewThreadSelector:@selector(threadProc:) toTarget:self withObject:nil]; that tri...

Cocoa Speech Synthesis, save Audio to a buffer for use in OpenAL

Hi, I want to translate text to audio on osx similar as done here: http://developer.apple.com/library/mac/#samplecode/CocoaSpeechSynthesisExample/Introduction/Intro.html . After the sound is finished playing I would like to save it to a buffer for further use in openAL, is that possible? The only way I see right now is to save the spe...

Create an NSMutableArray using NSCalendar

Hi, I have following problem: I need to create an NSMutabeArray with every weekday after a specific date. This should look like: Thursday 28 october 2010 Thursday 04 october 2010 Thursday 11 october 2010 ... How can I do that? I think it has something to do with NSCalendar, but I can't find the right solution... Could you help me? ...

NSURL fileURLWithPath where NSString has a space

Hello, I've looked at quite a few of the related questions and cannot find a similar problem or a solution so my apologies if there is a duplicate out there somewhere. Anyway, I'm trying to generate a file's NSURL to use with an NSXMLDocument. I have the following components: const NSString * PROJECT_DIR = @"~/SP\\ BB/"; const NSStrin...

What is the state of TWAIN on the Macintosh today?

I'm currently working on a project where we want to interface with TWAIN scanners on both the PC (Windows) and the Macintosh. On Windows, we basically have everything squared away and the code works successfully with the vast majority of scanners. On Mac OS X, we also basically have everything working and with the main scanner we used...

saving images in lower quality(256, 16, 4, 2 colors) - cocoa

Hi. I am trying to work with images in Cocoa - open images and manipulate with them. I take ImageApp as example . All work fine, but I need to save images in lower quality -(8, 4, 2, 1 bits per pixel - 256, 16, 4, 2 colors respectively). According to documentation, the "lowest" pixel format is Gray 8 bpp, 8 bpc,kCGImageAlphaNone and i...

NSTextView overlay causes oddities with first responder status

I have an NSTextView in an NSScrollView, and I am programmatically inserting an NSView subclass as a subview of the NSTextView. This NSView acts as an overlay, superimposing graphical information about the text beneath it. I thought it was working quite well until I noticed that the text view does not respond to right clicks. Other op...

NSSpeechSynthesizer delegate method always reports an error, but which one?

I have the following delegate method for NSSpeechSynthesizer: - (void) speechSynthesizer:(NSSpeechSynthesizer *)sender didFinishSpeaking:(BOOL) success { NSLog(@"Finished correctly = %d", success); [startButton setEnabled:YES]; [stopButton setEnabled:NO]; } The parameter "success" is always NO, even though I heard everyth...

Autorelease pools in appkit applications

I'm having difficulties to understand exactly WHEN autorelease pools are created and released in AppKit apps. For example, if I have an ApplicationController class that overrides init, is there an autorelease pool that gets created before it starts and gets drained after it ends? ...

How can I convert the characters in an NSString object to UILabel objects?

Hello. I'm trying to figure out how to take the individual characters in an NSString object and create UILabels from them, with the UILabel text set to the individual character. I'm new to Cocoa, but so far I have this... NSString *myString = @"This is a string object"; for(int i = 0; i < [myString length]; i++) { //Store the cha...