cocoa

XML Schema Binding / Object Model Framework in Cocoa

New to XSD here. Has anyone found or written a framework for working with XML schema object model in Cocoa/Obj-C? What I really need is the ability to define permitted types of modifications to an NSXMLDocument, as described in an XSD File. This includes defining sequences of child elements, list of attributes and their permitted valu...

Question about naming conventions for Cocoa/Objective-C for iPhone (with respect to release and autorelease)

Can you describe the naming convention difference between a method that returns an object it has allocated for the caller (and that the caller should release), and a method that returns an autorelease object? ...

iPhone Question about properties

If you declare a property with a retain attribute, do you need to release the property before you set it to nil? What does the @synthesize directive do? ...

NSTableView Issues...

I'm trying to follow this tutorial on binding: http://andrehoffmann.wordpress.com/2009/09/03/phonebook-tutorial-for-dummiesxcode-3-1-3/ but the app keeps crashing at run time. In IB I have a NSBUtton, NSTableView, NSArrayController and a NSOBject (named AppController) The tableview has 3 cols. Ad Name, Col and Height. In AppContro...

Rounding NSDecimalNumber

I'm having the hardest time figuring out something that seems like it should be very simple. I need to accurately round an NSDecimalNumber to a particular number of decimal places (determined at runtime.) So far as I can tell, I have two options, neither of which I like. Convert to a float, and use C rounding functions: I don't like th...

Cocoa - Open File Package in Finder

Hello, I am trying to open the Finder in a certain package. I got this file, Example.backup, which is just a folder with an extension. In the finder, you can right click it (Show Package Contents) and I will be presented with the files. (there is no Contents folder). I've tried opening it with NSWorkspace's methods but none open th...

How to prevent NSSearchField from overwriting entered strings using the first autocompletion list entry?

I am looking for a way to create an nssearchfield that behaves as follows: user types in text based on matches an autocompletion drop-down appears the text in the search field does not autocomplete to the first item in the list The point is, my string matching searches for any substring and autocompletion in the text field woul...

How to change the value of an NSMutableArray at a particular index

[array objectAtIndex:i] doesn't work as an L value, so it can't be used to set the object at index i. ...

Modal view controllers calling other's "viewDidLoad"

I have a bunch of pages I am chaining together and presenting as modal view controllers. THey all have viewDidLoad methods. It seems that when one is loaded though it calls the viewDidLoad methods of ones in the background too. How can I stop this? Thanks! ...

"Dangling reference to an invalid object" error in Core Data with seemingly valid objects

I'm having a really confounding problem using Core Data. In my Core Data store, for an existing Core Data object, I'm checking whether a relationship exists, and if not, I create the object like so (this is a method on AFFingerprintGeneratorOperation): NSManagedObjectContext *newContext = [[NSManagedObjectContext alloc] init]; [newCont...

Crash during typing data in web view.

Hi all, In a sample application when I tried to enter data in a webview it crashed. Below is the part of crash report- Process: RCS [38246] Path: /Applications/RCS.app/Contents/MacOS/RCS Identifier: com.tprf.RCS Version: 1.5.10 build-0212 (1.5.10) Code Type: X86 (Native) Parent Process: launchd [152] ...

what is the program flow in Cocoa Applcation

Hi, I am new to mac os X development ,I downloaded an open source mac application ,but i couldn't able to understand the flow of execution of cocoa program.so any one can explain the program flow of a general cocoa program briefly. Thanks in advance ...

custom NSSliderCell

Hi guys, I've sort of accomplised implementing a custom slider cell that can draw over using images for the scroll bar and knob. The only obstacle that is in the way now is this, when I drag the knob quickly, the images get messed up. i've posted a screen shot. http://img818.imageshack.us/img818/1730/duhm.png Here is the code: #import ...

Should I call [super awakeFromNib]?

If i implement my own version of awakeFromNib, should I call [super awakeFromNib] at the end of my method? ...

Intro to Cocoa Speech question

I am just starting my cocoa education and I had a quick question, I see that the ability to click a word and have the mac text-to-speech functions say that text is built in automatically. (ie - for the hello world app, you can click hello world and in the menu have it say "hello world" back to you) My question is this, is there a way f...

How to make action of other application?

Greetings, I need to make action in other (not mine) application. Lets say, Photoshop toolbar. Is there any way to click any button of Photoshop's toolbar from my cocoa application? ... I found: - NSRunningApplication - Accessibility API - Quartz Events - ...and this But it's still not enought. Any idea? Any solution? Thanks and ...

Implementing an NSOutlineView to edit the contents of a plist file

I'm writing a game using cocos2d-iphone and our stages are defined in .plist files. However, the files are growing large - so I've developed an editor that adds some structure to the process and breaks most of the plist down into fixed fields. However, some elements still require plist editor type functionality, so I have implemented an...

Cocoa (Snow Leopard) NSTextView's textStorage -setAttributes:range: removes characters!

I'm not sure what I'm doing wrong. I have a NSTextView and am registered as the delegate for its textStorage attribute. When I receive -textStorageDidProcessEditing:notification: I'm trying to apply attributes to ranges of characters within the text. It certainly does "something" to the characters, but not what I expect... they just d...

Cover screen with window in cocoa

Hello- I am writing a Mac application, in Cocoa, that needs the ability to 'lock down' the computer. Basically, I am writing a small agent that will sit in the background and when prompted, throw up a window that covers the entire screen, including the status bar, and shows a message (something like "give me back my computer, thief!"). ...

iPhone file IO in pure c/posix style

Hi, is there a way to write files to the iphone file system using only pure c code and some posix like api? I only found some Objective-C/Cocoa stuff out there and I think that I can't just mix some Objective-C code snippet into the .c file. ...