cocoa

Properties and Instance Variables in Objective-C

I'm rather confused about properties and instance variables in Objective-C. I'm about half-way through Aaron Hillegass's "Cocoa Programming for Mac OS X" and everything is logical. You would declare a class something like this: @class Something; @interface MyClass : NSObject { NSString *name; NSArray *items; Something *so...

NSCollectionViewItem double-click action?

How do I set an action for when a user double clicks an NSCollectionViewItem. NSTableView, for example, has the setDoubleAction method. Is there something similar for NSCollectionView? Thanks ...

How to add a new Menu at the end of MenuBar?

One question is : Now I want to add a new Menu at the end of MenuBar, not to add a menuitem at the known menu. just like the Xcode Items: The last menu is Help , I want to add a new Mneu(MyMenu) behind the Help Menu ? How to do ? Thanks very much! ...

How to set Image Perspective

Hi, I am working in Mac OS X, 10.6 How can i set the image perspective of any image? I do not want to use CoreImage. Is it possible to do it via NSAffineTransforms. Regards, Dhana. ...

Linking to PostgreSQL and SSL

Hi, I'm trying to use libpq, the client library for PostgreSQL in a Cocoa app. First thing, adding the header files: I tried adding the path to the PostgreSQL header files under User Header Search Path on my project's properties and then compile but for some reason XCode can't see them. The solution was to manually add the files and a ...

Key value Observing during UIView Animations

Hi, I'm animating the center property of a view in my program. During the animation, I need notifications when center hits a particular value. I tried adding the myself as a key value observer for the center property of the view . However, I only get notified when the animation begins. So I'm unable to detect if/when the object passes ...

set custom length and width NSWindow

For my application I want to set a custom length and width for my NSWindow from within the application itself. I have everything set up (the NSTextfields) however I'm stumped with how I should do it. ...

Replace " " character in an NSString with "\ " (to create a Unix path)

Using the following doesn't work: - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement By doesn't work I mean does not do any replacement what so ever. It returns the same exact string. Is there a convenience method to do this? Similar to: - (NSString *)stringByReplacingPercentEsca...

How to pause an NSThread until notified?

I have a worker thread that I want to do one bit of its task, then pause & wait for the "ok, continue" command from another thread, then pause & wait, etc. The use case is: the controlling object is a view that I want to display information about what's going on inside the worker-thread, and allow me to "single-step" through the worker ...

Are There Any Good Open-Source Mac Application Templates

I am looking to make a Mac version of one of my iPhone apps and was looking for a good ay to hit the ground running. I know how to code in Objective-c and Cocoa, and I know how to piece something together from scratch if I have to, but I am looking for an easier way. Are there any open-source templates for coding Mac desktop applicatio...

Core Data Migration Across Multiple Version Upgrades

I have an iPhone app that uses Core Data. I did an update and used Lightweight Migration to go from V1 to V2 of my MOM (Managed Object Model). This worked perfectly. What happens when I want to go to V3 (and beyond) of my MOM? If I decide to continue with Lightweight Migration, will it automatically deal with migrating from V1 to V3...

SQLite Access in Objective-C and Cocoa

Hi Everyone, I am in the process of learning Objective-C for Mac/iPhone development and decided to try and write something useful without looking at the bible (Aaron Hillegass: Cocoa Programming 3rd Edition). I'm writing a simple puzzle game. The data that defines the levels is stored as a string in a SQLite database and read into a le...

How can I view an NSError?

What's the best way to log an NSError? - (void)epicFail:(Lol *)aLol withError:(NSError *)error { NSLog(@"Error: %@", error); } Gives me a null message Thanks. ...

How do I embed a WebView in an NSScrollView?

So I have a project that has some content being displayed in a WebView and I want to stick above that. I want the header to scroll with the WebView content. Now, WebView generally wants to do it's own scroll handling but you can tell it not to using: [[webView mainFrame] setAllowsScrolling:NO]; which successfully makes the WebView's...

Cocoa JSON - Check whether array or dictionary

Hi, I am using the Cocoa JSON framework ( http://code.google.com/p/json-framework/ ) to communicate with an API. The problem is that the API returns a dictionary if there is an error but returns an array of the results if it works. Is there a good way to detect if the JSONValue is an array or a dictionary? Thanks. ...

Cocoa touch - problem with button-viewController connection

Hello, I'm very new to cocoa touch and am stuck on a problem that doesn't seem to have a google solution. I have added a view to my application, and this view has a button on it. When the button is pressed I want the callback to perform an operation. My problem is that the callback isn't being called. I created the view in Interface...

Creating a tab view programatically with Cocoa/Objective C

I need to create a tab view programatically using objective C and cocoa but I can't find any good resources showing how to do this. Can anyone suggest something? ...

Aquatic Prime on 10.6?

Hello, I have 2 applications that I use with Aquatic Prime. One is an application just with the Aquatic Prime framework, and the other is an application that I've been working on that has been incorporated with the Aquatic Prime framework. The first application I mentioned before has its SDK set to 10.5 with the architecture to 32-bit. ...

Validation Errors with Core Data Migration

I'm encountering a very annoying error using Core Data on Mac OS X 10.5. All entities have classes in my application which share the same names. Up to this point, I've done 5 migrations without problems. I'm using the XML data store. I've got V5 of my data model with 13 entities, 4 of which are abstract. It looks like this: What I d...

How do I set Cocoa NSLevelIndicatorCell values?

I have a tableview. One of the columns in the tableview uses an NSLevelIndicatorCell. I want to be able to allow the user to edit the warn and critical values for the level indicator such that when they enter a value into a a "warning level" textbox, it changes the warn value of the level indicators being displayed in ALL of the tablev...