PDA

View Full Version : Basic Xcode questions


Wyatt
2007-04-19, 20:57
I'm building a simple document-based Core Data application in XCode (just playing around with it, really), and I have a couple of questions.

1) In my NSTableView, one of my items (a string) is defaulting to zero, and even when I change it, it changes back as soon as I tab out of that field or press return or enter. The column is flagged as editable, and I don't have a default value set for that property in my data model.

Nevermind, I figured that one out. As it turns out, "version" is a reserved name and shouldn't be used as a property name. I changed it to "versionNumber" and it magically works.

2) How can I make my application open the most recently modified file automatically on startup? I doubt I'll ever use more than one file with this, so it would be nice to be able to open it automatically.
2.a) How can I make files created by my application automatically open with my application when I double-click them in the Finder? I got it to work a couple times by using the "Always Open With" right-click menu, but it stopped working after I modified and saved the file. Is there any way for me to create a custom file extension and register it with OS X so that every file of that type I open will just open with my app?

3) I've just noticed that my .app file being compiled by Xcode is flagged as an Intel application in the Finder. I don't care so much about this app, since I'm only making it for my own use, but I might develop something in the future that I'd like to distribute. How can I make my app universal?

I'm sure I'll probably have a few more questions later. I've worked through most of my issues, though, and I'll be satisfied with this for my own use once I get these two things figured out.

bassplayinMacFiend
2007-04-20, 14:23
In Xcode, check out your application properties. One of the first options lets you select Intel, PPC or (by checking both boxes) both.

As for opening the most recently opened file, you'll probably need to set up a plist file with the most recently opened file as a Key in the Dictionary. Then just retrieve the Value on startup and open the file.

I'll try to dig up a sample project I have on building an application preferences and post it here. I can't promise anything though as my 2 year old gets all my attention at home now.

RobUSVI
2007-05-18, 06:50
> How can I make my app universal?

http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/index.html#//apple_ref/doc/uid/TP40002217