Did Xcode 8.3 update eliminate the basic AppDelegate project template?

Hello all, I'm new to the whole apple development scene, struggeling a bit as I'm trying to learn Objective-C Cocoa developemnt. I'm using an older book that is a bit of our sync with Xcode version but so far has been liveable.


Tonight I updated Xcode to Version 8.3 (8E162) and I seem to have lost the ability to create simple applications that only include the AppDelegate templage and the MainMenu.xib. Now it seems like your only choice is to create a storyboard or document based application, and both have these new ViewController classes to deal with.


I'm certainly not resistant to learning somthing new, but this change pretty much fustrates the process of following along with my book's examples, etc.


Is there any way (short of uninstalling and finding an older version) of forcing Xcode to go back to the old behavior?


Thanks

Accepted Reply

I noticed this also. You can "create" an old-style single window-base app with the new 8.3 as follows:

  1. create a mac os x app using the Cocoa application template (which will be story board based)
  2. delete the storyboard xlb file and viewcontroller swift file from the project (move to trash option with DELETE)
  3. in the project info area, delete the NSMainStoryBoard entry
  4. add new file to the project: choosing MainMenu as file type
  5. in the MainMenu.xlb, add a window
  6. back in the project info section, add "Main NIB file base name" key entry with value MainMenu (to do this just click on + for any entry and then scroll down to find the Main nib file base name key and select it)
  7. run the project - it should work as the older single window-base template did

You can then add more UI stuff, etc. as before.


If you need to customize the AppDelegate behavior, add Object to yoiur MainMenu.xlb file and change its class to AppDelegate; then add a new Referencing Outlet to this object which you will connect to File Owner Delegate outlet.


This procedure is a bit messy, but there might be a way to create a "template" using this project as the model.


NOTE: I use only Swift Language projects, but I guess you can choose objective-c as the language when you first crate the project.

Replies

I noticed this also. You can "create" an old-style single window-base app with the new 8.3 as follows:

  1. create a mac os x app using the Cocoa application template (which will be story board based)
  2. delete the storyboard xlb file and viewcontroller swift file from the project (move to trash option with DELETE)
  3. in the project info area, delete the NSMainStoryBoard entry
  4. add new file to the project: choosing MainMenu as file type
  5. in the MainMenu.xlb, add a window
  6. back in the project info section, add "Main NIB file base name" key entry with value MainMenu (to do this just click on + for any entry and then scroll down to find the Main nib file base name key and select it)
  7. run the project - it should work as the older single window-base template did

You can then add more UI stuff, etc. as before.


If you need to customize the AppDelegate behavior, add Object to yoiur MainMenu.xlb file and change its class to AppDelegate; then add a new Referencing Outlet to this object which you will connect to File Owner Delegate outlet.


This procedure is a bit messy, but there might be a way to create a "template" using this project as the model.


NOTE: I use only Swift Language projects, but I guess you can choose objective-c as the language when you first crate the project.

Thanks for that, I think it will work for me. Looks like (in this respect) there's no real difference between the Objective-C and Swift projects.


I think I was able to recreate the simple application template with a few minor tweaks.


After step 6 I needed to create a new window object. After that I was a little fuzzy on your last note about File's owner but was able to figure it out by control-click on the MainMenu XIB File's owner object and click/dragged the Delegate outlet to the newly created class object.


For the most part it now looks the same as before and presents the familiar blank window when you run the project.


I am going to try it tonight and re-do one of the simpler exercises using this template as a base.


But thank you for your response! You just saved my sanity!


The book I'm following is "Cocoa Programming for Mac OS X, Fourth Edition" (2011) which seems to be the most recent guide on Objective-C/Cocoa programming I can find. Due to it's age, it is based on Xcode 4.x which is hard enough to translate into Xcode 8 for a novice. This last Xcode update eliminated any chance for me to follow along in this book and you may have just gotten me back on track.

glad you got it to work; regarding adding a window - that was actuallly step 5 (ie I added a window to the MainMenu.xlb file after creating it).


PS - you should really consider learning and using Swift rather than objective-c, especially going forward 🙂

I disagree. Swift doesn't offer any real advantages over Objective-C. Objective-C will be around for a long time.

Thanks. You were right, sorry I'm still learning the whole Xcode interface.


I ran through another book exercise tonight and "flawless victory" for me thanks to your recipe for correction above.


As for Swift vs. Objective-C, I knew nothing of Apple programming or its API's and needed to pick a path. I had prior experience with C and systems programming and thought Objective-C would be the better to try, especially with Swift still evolving. Likely I'll try Swift sometime soon, but I feel like what I'm doing now is good experience.


Thanks!

fwiw - I copied the 5 template files for the cocoa application from xcode 8.2.1 into a custom template directory for xcode 8.3; did some minor editing on them to make their ids unique and they work fine. When either a swift or objective-c cocoa app is created from this project template it has the old-style window-based ui.

Which ID's did you edit. I have tried this and have not been abel to make it work.

Alfamsome2 hello,

Can you outline the exact steps needed to create and use the templates for the old-style UI?


Also, could you do similar for the old-style Document based application? Specifically, I'm not sure where to point the File owner's delegate to.


Thanks