cocoa

Is there any method in Cocoa that helps iterating through all NSColor values(R,G,B only, alpha not touched)?

I need a function that for a given R,G,B values returns the next color. By saying the next color I mean the color which one of the components change by 1(assuming that R,G,B values are of range 0-255). It has to be constructed that way that starting from the white color(or black alternatively) you can iterate throught all of the colors...

Cocoa/Objective-C - Child window with text input without main window becoming inactive

Hello All, I have a need to spawn a window that will hover just above my main window in a cocoa application. I want this main window to allow the user to enter some text in an input box. All is well until the text input box actually gains focus. The main window becomes "deactivated." This window is borderless and is a slightly custom sh...

Laggy interface with NSSearchField hooked up to an NSArrayController via bindings

So I've got an NSSearchField hooked up directly to an NSArrayController via bindings, attached to the filterPredicate, so that without any code, the user can just type in the NSSearchField and filter the list of objects in the NSArrayController presented to him in the interface (an NSCollectionView, to be specific). The NSSearchField is...

Is NSNumberFormatter the only way to format an NSDecimalNumber?

I'm using an NSDecimalNumber to store money in Core Data. I naively used stringWithFormat: at first to format the value, later realizing that it didn't support NSDecimalNumber and was instead formatting the pointer :(. So after some reading through the docs I learned to use the NSNumberFormatter to get the format I wanted. But this just ...

asyncsocket Write Issue

I am attempting to use asyncsocket to communicate GPS data from a server app on my iPhone to a client app on my macbook. The two devices connect without any problems, and when the first data is sent from the iPhone to the laptop in asyncsocket's didConnectToHost method, the data is sent without hiccup. When I subsequently try to write ...

Custom transitions between view controllers?

Is there a good way to provide custom transitions between view controllers? For example, in the Photos app on the iPad, tapping on a photo album changes the navigation controller, but it also animates nicely into the grid of photos. Thanks. ...

cocoa Expected specifier-qualifier-list before struct

I read the other posted solutions to using structs and resolving the "Expected specifier-qualifier-list before struct" related errors, but those aren't working. Is it different in Objective C? Do I need to declare my struct somewhere else in the class? It gives me the error on the line where I declare the typedef. Here is how it look...

Sharing config settings between 2 cocoa apps

I am new to cocoa development and want to create a little app. For that app I need a background worker that is running all the time and a prefpane-app that gives the user the opportunity to change the settings for that background worker. The gui for the prefpane is ready, the background worker is ready, too. One of the few missing thing...

How to remove cursor from text field on click of button?

Hi all, I am trying to do a simple task: I have an editable text field, two buttons (titles: make editable/ make un-editable) over a window. Idea is: when user clicks "make editable" button, text field should become editable and when he/she clicks "make un-editable", it should become un-editable. In action of "make un-editable" I am ...

There's already an instance of AddressBookSync running. How to resolve this error?

I am deleting contacts from addressbook programmatically. I got error "There's already an instance of AddressBookSync running" on console and my application is not responding. There are 5000 contacts in addressbook. When iSync preferences option "Enable Syncing on this computer" is unchecked then all is working well. But when it is che...

What is alternative of "QDDisplayWaitCursor"?

I am trying to display wait cursor (spinning rainbow wheel) by using "QDDisplayWaitCursor" function, but I get a warning that "QDDisplayWaitCursor" is deprecated, however everything runs fine but I would like to replace it with proper alternative of this function but I didnt find any google result and also in apple docs. ...

NSURLErrorDomain error -3001

Hi, I'm trying to download a file from the internet, but I get the error -3001 back. I've been searching through google but the error doesn't appear on any website, so i have no idea what it means. Can anyone tell me what the error code "NSURLErrorDomain error -3001" means? Thanks ...

Hit Testing with CALayer using the alpha properties of the CALayer contents.

I'm writing a game for Mac using Cocoa. I'm currently implementing hit testing and have founds that CALayer offers hit testing, but does not seem to implement the alpha properties. As I have at times many CALayers stacked on top of each other, I really need to find a way to determine what the user actually meant to click on. I'm thinki...

problem in loading a model View

I have written a code for mail application like: { MFMailComposeViewController *picker=[MFMailComposeViewController alloc] init]; ......... ......... [self.navigationController pushViewController:picker.view animated:YES]; } The view is not getting loaded.Is is mandatory to write [self presentModalViewController:picker anima...

Forcing Reload of View when returning from FlipSideView of Utility Application

I've got a Utility Application for iPhone 3.1.3. I have my main view loading fine. I flip over to the flipside view of the utility app and change some settings. How can I call the code I've currently got in viewDidLoad in the main view to refresh it, as settings have changed? Do I create a public method and call it from the viewDidUnloa...

What's the easiest way to work out the difference between two positive integers?

I just need to know the difference between two int variables a and b. I'm new to Objective-C. ...

Presenting UIModalViews in Landscap mode

Hello, I'm trying to present some UIModalFormSheets in a my iPad application. It's working without any problems, except one thing: When I have my iPad in landscape mode my modal form sheet is moving to the center of the screen and THEN rotates into the appropiate angle. All I want is to present the modal form sheet in the right angle a...

Creating a Cocoa Framework

Hi, I've created a working Cocoa framework which I wish to redistribute. The problem is however, it won't run outside of Xcode. I've read something about @executable_path/../Frameworks, which I did not include, because I don't know where to put it :/ Therefore I run my app in Xcode using the DYLD_FRAMEWORK_PATH variable which works fi...

NSDrawer delegate pointing to deallocated object?

A user has sent in a crash report with the stack trace listed below (I have not been able to reproduce the crash myself, but every other crash this user has reported has been a valid bug, even when I couldn't reproduce the effect). The application is a reference-counted Objective-C/Cocoa app. If I am interpreting it correctly, the cras...

Parsing a simple XML from string in Cocoa?

I have a simple XML and I need to get the first 'id' from puid-list. I found lots of examples but none of them quite do that because of the namespace. How do get the id out as an NSString? PS: I'm on a Mac. <genpuid songs="1" xmlns:mip="http://musicip.com/ns/mip-1.0#"&gt; <track file="/htdocs/test.mp3" puid="0c9f2f0e-e72a-c461-9b9a-...