cocoa

How do I copy or move an NSManagedObject from one context to another?

I have what I assume is a fairly standard setup, with one scratchpad MOC which is never saved (containing a bunch of objects downloaded from the web) and another permanent MOC which persists objects. When the user selects an object from scratchMOC to add to her library, I want to either 1) remove the object from scratchMOC and insert int...

displaying web pages over web views in collection view using cocoa bindings

Hi all, I tried sample example given at this link - Collection View Programming Guide It is simple and it worked. Considering it as a reference I tried a simple application which will show a collection view of web views with some web page displayed over each web view. The model class has two properties: NSString *pageName, and NSURL *...

Enable LLVM + Clang in Xcode new project causes linking errors

I've done a complete clean uninstall of XCode and deleted the prefs and deleted complete /Developer folder and reinstalled XCode again. I create a new Cocoa application, go over to Target, doing a "Get info" in the target and enable "C / C++ compiler version" to "LLVM compiler 1.0.2" and press Build. I get: ld: warning: directory '/us...

Can I used [NSObject hash] to store NSView's in a dictionary?

I've read that -hash does not return the same value on different architectures. However, I don't currently see this in the docs. Is there a better way to store NSView's in a dictionary without subclassing? ...

Using web view behind a proxy (cocoa)

Hi, I'm creating a web-browser type app (using a web view object) that needs to be able to connect to the internet via a proxy. Server, port, username and password can all be hardcoded into the app but unfortunately I have no idea how to customise the proxy settings of a web view without changing the system wide proxy settings. If you k...

QTKit Capture API: How to implement video screen recording (as in Quicktime X Player)?

Does the QTKit Capture API support screen recording- i.e., can I specify the current screen output as the input source to record? If so, how? Quicktime Player X supports screen recording, yet the QTKit Capture API Documentation only mentions capturing from external cameras. ...

OBJ-C - Getting a class name from a class hierarchy

Let's say I have the following headers: @interface SuperClass : NSObject @interface SubClass : SuperClass I'm alloc'ing an instance of the class by doing: SubClass *sc = [[SubClass alloc] init]; In my SuperClass.m: - (id) init { self = [super init]; if (self != nil) { NSString *cString = NSStringFromClass([self class]); ...

What are the correct bindings for an NSComboBox for use with Core Data

Imagine if you will a Core Data app with two entities (Employee, and Department). Employees have a to-one relationship with department (department) and the inverse is a to-many relationship (employees). In the UI you can select individual Employee entities and edit the details in a detail area (there are of course other attributes and th...

how to get list of installed appications on mac

I need to get list of installed applications on leopard / snow leopard. Can any one suggest me how I can get list of installed apps using my cocoa application. I have tried using "system_profiler SPApplicationsDataType". Problem with this is it just lists out *.app files, which includes the drivers as well. Is there a way to get only li...

persistant '<class>' may not respond to +method

I've found a bunch of posts on this problem and have actually managed to removed one of the warnings i was getting from these however one persists. Some context: I'm creating currency converter as an exercise in learning Objective C My Rate class represents a rate that a currency can be converted to or from looks like this: Rate.h //...

Change NSTimer interval for repeating timer.

Hi, I am running a mainLoop in Cocoa using an NSTimer set up like this: mainLoopTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/fps target:self selector:@selector(mainloop) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:mainLoopTimer forMode:NSEventTrackingRunLoopMode]; At Program startup I set the ti...

QTMovie Player Left and right speaker sound.

hey all I am using two QTMovie object for playing a two mp3 file. I want one mp3 file sound came from left speaker and another mp3 file sound come from in right speaker. Also i want how to manage left and right speaker sound. Please suggest,how can I do this. Thanks Mandeep ...

[[NSURL alloc] initFileURLWithPath:(NSString)] returns null

NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"Opening" ofType:@"wav"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath]; NSLog(@"@ajay"); AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil]; [fileURL release]; [audioPlayer play]; ...

Using enums and switch statements in a class

How would I make the following calculator Class work?: //Calculator.h #import <Cocoa/Cocoa.h> @interface Calculator : NSObject { float initialNumber, operandNumber; typedef enum{ additionOperation, subtractionOperation, multiplicationOperation, divisionOperation }operationType; } @property(readwrite) float...

Adding Cocoa to a Carbon app?

Hi All, So We have a really old project that is all Carbon. We need to modify the way we open and save files and the dialog code we use is to old, so I wanted to create this new in Cocoa. How does one create a Cocoa Class that can be called from Carbon? What Cocoa routines would I use to create open and save dialogs and present them t...

rotate an object with touch

I'd like to allow the user to rotate a wheel displayed on the iphone. The center of the wheel is the center of the screen. For now, I manage to rotate correctly in basic situations, following the finger gestures. However I have troubles when I try to react to "throw" gesture: I can't determine the rotation direction from user touches. ...

Code Signing Services

I'm developing a System Preference Pane that runs a background application. I'm planning on codesigning the background application and I'll be using the kill flag of codesign (http://gemma.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/codesign.1.html). From my understanding, this kill flag will not allow the backgrou...

A way to enable a LaunchDaemon to output sound?

I have a small Foundation application that checks a website and plays a sound if it sees a certain value. This application successfully plays a sound when I run it as my user from the Terminal. I've configured this app to run as a LaunchDaemon, with the following plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//...

Multiple NSURLDownloads with Progress

Hello, I'm trying to build a small app which allows downloading of multiple files at the same time while displaying them in a custom NSTableView. This works, i've done this by using an NSEnumerator, but I struggle at getting the progress right. It's calculated correctly, but it's not done individually for every download, instead they're...

Reranging a uitableview

Hallo @ All I ran into the same problem as desciped in http://stackoverflow.com/questions/1884491/crashing-while-trying-to-move-uitableview-rows! All I want to do is on specific reranging operations insert a new cell or delet the selected one! Sometimes I get a * Assertion failure in -[_UITableViewUpdateSupport _setupAnimationForReord...