cocoa

Heterogeneous NSTreeController

I have an NSTreeController (supplying content to an NSOutlineView). I'd like the top-level objects to be of one class, and all other objects (so, children at any level) to be of another. What's the best way to go about this? I'll need to somehow change the behavior of at least add, addChild, insert, and insertChild, I suppose. I was hop...

NSThread with class method?

Is it possible to run a class method (starting with a '+') in a separate thread? Normally I call the method like [myClass myController]; I tried [NSThread detachNewThreadSelector:myController toTarget:myClass withObject:nil]; without success. ...

Does strokeRect: of NSBezierPath always draw a transparent rect? (Cocoa OSX)

I am trying to make a custom selection box for an image view I created and I am trying to use strokeRect: from NSBezierPath but it always seems to be transparent. Called the method set to set the color the blackColor and then also tried using olorWithDeviceRed:green:blue:alpha: but no matter what I have tried the rectangle created alwa...

Error "Create a concrete instance!"

Hey All, I've got another problem in the same code... I'm getting this error: initialization method -initWithCharactersNoCopy:length:freeWhenDone: cannot be sent to an abstract object of class NSString_RegEx: Create a concrete instance! But I don't understand the error or what I should do... edit: NSString *pageContent = [[NSStr...

How do I create rows with alternating colors for a UITableView on iPhone?

Hi all, i would to have alternate 2 colors of rows, like the first black, the second white, the third black, etc, etc... my approach is like a basic exercise of programming to calculate if a number is odd number or not: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSStr...

How do I test how customers use my Cocoa application?

I'm interested in finding out how customers use features in my Cocoa application. I want to build up statistics on which features people use and how they use them, so that I can measure the value of features I'm implementing. I'm building a desktop app to run on Snow Leopard. This feedback of course will be opt-in and anonymous. Doe...

No test coverage files generated for Unit Test bundle in Xcode

The Problem I've got a Cocoa project on the desktop and I'm using Xcode 3.2.1 on Snow Leopard 10.6.2. I want to generate code coverage files for my Unit Test Target in Xcode. What I've Tried As articles like this one suggest, I've adjusted the build settings to: “Generate Test Coverage Files” checked “Instrument Program Flow” checke...

Trying to create link with NSTextField

I'm using this category (is that right?) http://www.nightproductions.net/references/dsclickableurltextfield_reference.html#setAttributedStringValue to implement clickable textfields. I've imported the header file in my controller class and set it's attributed string value like this NSAttributedString* str = [[NSAttributedString alloc] ...

How do I get current network location name?

In system network preference there are some location names.How to get the current or active network location name and list of all network locations? I guess SystemConfiguration.framework supports this but i didn't get exactly which API to use.Thanks in advance for your answer. RegardsDevara Gudda ...

Cocoa:NSUInteger vs unsigned int When the Range is Very Small?

I have an unsigned int variable and it can only have the values of 0 -> 30. What should I use: unsigned int or NSUInteger? (for both 32 and 64 bit) ...

Check if last characters of an NSString are numbers.

Is it possible to see of a string ends with a number which length is not known? "String 1" -> 1 "String 4356" -> 4356 "String" -> nil If so, how can I determine that number? ...

Core Animation not working on Leopard, working on Snow Leopard

Hi, I animate NSImageViews using its animator proxy. While testing my application on Snow Leopard, everything works as expected. However, on Leopard, none of the animations are functioning. In addition, NSImageViews don't seem to take into effect the alphaValue I set on them, whether through the animator proxy or not. The only way I...

NSPredicate by NSManagedObject for many-to-one lookups

Hi guys, I've got the scenario with two NSManagedObjects, Arm and Person. Between them is a many-to-one relationship Person.arms and inverse Arm.owner. I'd like to write a simple NSPredicate where I've got the NSManagedObject *arm and I'd like to fetch the NSManagedObject *person that this arm belongs to. I could make a textual repres...

Global variable call working only first time

Hello, I defined a global variable that is called from other view and it is working first time but not following ones, it keeps with value from first call! Suppose that is a cocoa fundamental problem and variable is not properly defined according its need. Thanks for any idea to solve it. declaration: @interface TableArchiveAppDelegate...

MobileMe Connection - Cocoa

Hi, I need to send a file to MobileMe via Cocoa. I stumbled across a .Mac framework from Apple but it hasn't been updated in years, so I don't want to use it due to possible compatibility problems it may cause. I think that the MobileMe.framework is private, so I don't think I can use it. What kind of alternatives are there available f...

Code Interaction with Quartz Composition

Hi, i have a Quartz Composition with a Cube, and X/Y/Z rotation inputs are published. On Interface Builder i made a QCView and a QCPatchController with the previous Quartz Composition loaded. In QCView the Patch Controller is binded, and the rotation published ports are binded too to three NSSlider, so when i change the value of the NSSl...

Adding ScrollView to a BottomView of Horizontal Split View in Cocoa

I have a custom View which i would like to place on a bottom view of split view dynamically. I need a scroll view for that bottom view. How can I get a scroll view for a bottom view of horizontal split view? Pleas help me on this. Thanks in Advance bp ...

How to allow click-through and a cursor in a background app while not taking the active appearance away from another app

Here are my goals: My application displays an overlay window above all applications' windows. The user can draw in the overlay window. The mouse cursor changes to a specific cursor while in the overlay window. The application that has the active appearance before summoning the overlay window still has it while the overlay window is up ...

Options for Cocoa-based text editor

Hello. I am working on a cocoa-based text editor. Should I base it on NSTextView or is there a more efficient option? Keep in mind that I plan to support tabs so there can be many editors open at the same time. ...

How to open multiple images and be able to drag them in Cocoa

Hello, I'm trying to make a board like that you can import as many pictures as you like to that board. How can I do that? handle multiple images? The other question is how to recognize a drag movement and move the image to the Cursor position? Thanks!! (Mac SDK) ...