On Apr 8, 2011, at 06:57, Logan Cautrell wrote: First I open my iOS project, then double click on the project file to open Project and Target settings in a new window. Add New Target -> iOS -> Application -> Window-based. I enter Product Name, select iPad for a device family, and finish. Now Xcode does some magic.
Part of this magic includes creating a new folder in the project root directory. Xcode 3 did not have this behavior, it would simply creating an info plist in the root project directory, aside from whatever gets added to the .pbxproj. This is the point where I run into problems. I don't want the directory or layout. Xcode 4 creates an app delegate, main.m, pch, en.lproj and info.plist. The only thing useful is the info.plist, all of those other files are completely useless for the new target.
I first open the Target settings -> Build Settings -> Packaging -> Info.plist File. I change it from Test/Test-Info.plist to InfoPlists/Test-Info.plist. In the Finder, I move the Test-Info.plist from Test into my InfoPlists directory. At this point Xcode is now in an invalid state, clicking on Summary shows empty fields that don't hold values for Identifier, Version, etc. Clicking back on Build Settings crashes.
This time after relaunch, Xcode seems to have figured things out. Maybe I was misspelling stuff the other time.
The empty value-losing fields symptom happened to me when the info.plist build setting was wrong. In my case, Xcode didn't (doesn't, just tried it again) crash, but both outcomes seem to me to be bugs. So, yes, you probably had a typo the other time. When you create a target, Xcode has to do *something*. If creating new supporting files for the new target is the more useful (to a majority of users) choice, then it's hard to argue with it. After all, according to your own description, you would have had to go move the info.plist file anyway, and deleting the rest of the files isn't terribly onerous -- only one step if you do it from within Xcode. However, I think you could make a very good argument that there should be an "Other" choice in the target template-selection dialog, which would only create the minimum set of files (no source). (Creating no files at all doesn't seem like a good strategy, because it means you start off with malformed build settings.) Sounds like an enhancement bugreport waiting to happen! Incidentally, I forgot about the target template thing because I'd started duplicating targets rather than creating new ones. That way I had less build setting re-configuration to do, and it didn't create any files for me.
It isn't terrible, but it is annoying that you already have a project with a main.m and app delegate, why create new ones? XC3 behavior was very simplistic, it just created a plist for you. I don't even need new plists for each the targets in my project, they all use the same one. Xcconfig files are the bomb, haven't gotten around to seeing those have changed as well though...
I can see arguments both ways, my experience that writing more configuration data is > writing more code. To each their own, I guess Xcode's default app targets wanting me writing more code. Which from a certain perspective makes perfect sense, it is a code writing app after all.
Target templates completely solve the issue for me, if I can get them to work. -logan
|