Window-Based Application

Moderator: JoeConway

Window-Based Application

Postby JoeConway » Wed Dec 07, 2011 4:08 pm

The Window-Based application template is gone in iOS 5.0. Additionally, templates come with ARC on by default. There's been a bit of discussion on some temporary fixes, but now I have a real fix after figuring out how to manipulate the templates. This is now *the* solution to the problem.

Here's how to make yourself fully compatible with the book:
1. Download the following file: http://www.bignerdranch.com/solutions/Templates.zip
(this URL is case-sensitive)

2. Navigate to ~/Library/Developer/Xcode/ in Finder.
(by default, ~/Library is hidden. You can use the keyboard shortcut Command-Shift-G in the Finder and enter this path to get to that directory)

3. Unzip the Templates.zip file and add the Templates directory it creates to ~/Library/Developer/Xcode

Now, when you create a new project, there will be an option for Window-Based Application.

Enjoy and share.
JoeConway
 
Posts: 792
Joined: Tue Apr 20, 2010 11:39 am
Location: Atlanta, GA

Re: Window-Based Application

Postby JoeConway » Wed Dec 07, 2011 5:43 pm

I should also point out:

In my opinion, going XIB-less for the Window is actually better than having a XIB. I'm glad they made this change to the templates. I'm not glad they did it right after the 2nd edition was published.

For your own projects, you'll want the Empty Application template. We had to go with the Window-Based Template in the book because there were no other options.
JoeConway
 
Posts: 792
Joined: Tue Apr 20, 2010 11:39 am
Location: Atlanta, GA

Re: Window-Based Application

Postby roblawson » Thu Dec 08, 2011 2:16 pm

Joe

Thanks much for your 7 Dec note on the windows based app template. It will help, I'm sure.

As a new person to your book (2nd edition) and to iOS programming, I have also found a
few new introductory (Xcode 4.2 and ios5) tutorials on YouTube to follow. However, to allow
me to (somewhat) sync up to your book, and given the information that the 3rd edition will not
be out until March-ish, is it possible that you could send out just chapter 1, the Quiz project, as a means
of getting started with Xcode 4.2 (assuming that it is written) and to better understand
what is involved with the new releases (Xcode and ios5? It is my intent to immediately
buy your 3rd edition upon release, but it would sure help a newbee like myself if I could
start down the path of current releases rather than use what has been.

Thanks

Rob
roblawson
 
Posts: 2
Joined: Thu Dec 08, 2011 2:03 pm

Re: Window-Based Application

Postby davidc » Mon Dec 12, 2011 12:04 pm

@Joe,

Thank you for posting this announcement. I am confused by the first sentence and the context of the thread.
The Window-Based application template is gone in iOS 5.0.

Who does this apply to? What is the problem the solution this offered for?

Are you referring to the 'window-based application template' in Xcode? My understanding is that the template is more a part of an Xcode 'New Project' (and the SDK) than it is of iOS 5. So, if I am using Xcode 4.1, as you suggested in another thread, does this apply? How?

I have been trying for almost 2 years to get my head around coding in iOS. Each time I download Xcode and find a tutorial, the 2 don't match... It really defeats the learning curve. Thanks for staying on top of this.

David
davidc
 
Posts: 9
Joined: Mon Dec 12, 2011 11:48 am
Location: NE Florida

Re: Window-Based Application

Postby arthury » Mon Dec 12, 2011 12:54 pm

Thanks, Joe, for the nice workaround.

Does anyone know if there is any good Apple docs somewhere describing the rationale and the details about the new style templates? The short descriptions at the CreateNewProject window is quite terse.
I am sure there are many curious minds out there asking the same question.
I do not seem to be able to find answers to this in the usual places in the iOS dev center.
arthury
 
Posts: 6
Joined: Mon Dec 12, 2011 12:45 pm

Re: Window-Based Application

Postby JoeConway » Thu Dec 15, 2011 2:45 pm

In order:

We are still going through preparing the next edition of the book. Not much is really checked at this point, so you'd probably have better luck without my error-riddled first chapter. In terms of what has changes, it is mostly the memory management scheme. We'll be adding new content and removing some stuff that didn't seem to be too popular. The only problem is templates because when they change, the step-by-step nature of our book is difficult to match.

Yes, this is a replacement for the Window-Based Application Template. It was removed with Xcode 4.2 - if you are still on 4.1, you won't need it.

I can give you the rationale for the new style of template: it is one less file to work with. The MainWindow.xib file didn't contain anything that you couldn't do programmatically. It should have always been this way, but we have to build the book according to the current Xcode version.
JoeConway
 
Posts: 792
Joined: Tue Apr 20, 2010 11:39 am
Location: Atlanta, GA

Re: Window-Based Application

Postby davidc » Thu Dec 15, 2011 3:03 pm

@Joe,

Please consider covering this Xcode version issue clearly & thoroughly in chapter 2, Installing Apples Developer Tools.

The only downer in using the book and this forum to learn has been the confusion over the Xcode version as I'm traversing chapters. My suggestion would be to pick a deadline and an identified version and stick to it through the whole book.

I'm still confused about which project (chapter) uses which version (features) of Xcode. Beginning chapter 12, Objects, I dumped 4.1 in favor of 4.2(.1) to get the template and main.m to look close to similar.

Thank you for your efforts.

David
davidc
 
Posts: 9
Joined: Mon Dec 12, 2011 11:48 am
Location: NE Florida

Re: Window-Based Application

Postby georghill » Sat Dec 17, 2011 1:53 pm

JoeConway wrote:I should also point out:

In my opinion, going XIB-less for the Window is actually better than having a XIB. I'm glad they made this change to the templates. I'm not glad they did it right after the 2nd edition was published.

For your own projects, you'll want the Empty Application template. We had to go with the Window-Based Template in the book because there were no other options.


After playing some time with the storyboard, I agree it seems great (from my humble beginner's perspective). But I am somewhat confused about the compatibility issues. I saw someone explaining storyboards are compatible only with iOS 5. But is this true? I mean it'd make more sense the storyboards would be just a new designing technique, not a feature of the iOS 5? So could someone verify if I can or cannot use the new Xcode 4.2 tools--including storyboards--and still develop apps that work on iOS 4.x?

Or am I stuck with xib method when wanting to develop for both iOS 4 and 5 (and wanting to use graphical methods building the interface)?

More generally, if I want to use the new 4.2.x Xcode Interface Builder, how do I ensure my apps are compatible with both iOS 4 and 5?
georghill
 
Posts: 1
Joined: Fri Dec 16, 2011 8:42 am

Re: Window-Based Application

Postby ta3ban4 » Fri Dec 23, 2011 6:15 am

Joe
I extracted the zip file and copied the directory structure of the unziped folder to ~/Library/Developer/Xcode then started the Xcode4 . After staring xcode4 I was unable to see the Window-Based Application option !! . I tried copying moving folders up from project Template that didnt work either . Any idea what went wrong ?

Mike
ta3ban4
 
Posts: 1
Joined: Fri Dec 23, 2011 3:00 am

Re: Window-Based Application

Postby curtmantle » Fri Dec 23, 2011 11:27 am

I have the same problem Mike.

I am new to the iMac (literally days). I downloaded the templates and dragged the Project Templates folder from the zip file into the ~\Library\Developer\XCode folder to give me these folders in the Xcode folder:

DerivedData
Project Templates
UserData

But none of the templates show up in Xcode.

I feel like I've tried to learn iOS development at the wrong time, when all the latest books have examples just prior to a significant change in XCode.
curtmantle
 
Posts: 8
Joined: Fri Dec 23, 2011 7:57 am

Next

Return to iOS Programming: The Big Nerd Ranch Guide (3rd Edition)

Who is online

Users browsing this forum: No registered users and 0 guests