I want to make a Cocoa applictation using all code in Xcode, not using the Interface Builder. I have searched a lot on this and have not found anything since most people want to use the Interface Builder. Please don't say anything like "Don't waist your time on it", "They did the work for you, why do it yourself?", etc., like most people. When I make applications, I like to use all code. So, can you explain how to do this or post a link?

Thank you very much for your help!

I had this in C++, which was the wrong place, so now I have it here.

Firstly, I don't believe you did really "search a lot" on this. I googled for "ios app without interface builder" and the first thing that came up was exactly what you're asking.

Here's a link http://lmgtfy.com/?q=ios+app+without+interface+builder

Here's another link to the first hit I got. I followed his tutorial in about 5 minutes (just to make sure he didn't have any errors in it) and it works fine. http://blog.austinlouden.com/post/47644085183/your-first-ios-app-100-programmatically

That should get you started.

For the most part, anything you can do in interface builder you can do it code. Your biggest asset here is going to be the apple documentation for the UI elements. The basic procedure is this:

  1. Allocate & init your UI element
  2. Set its size & position (frame)
  3. Set any constraints you want on it (autoresize masks, horizontal & vertical constraints, etc.)
  4. Add it as a subview.

Here are a couple more links to apple documentation that you should look through to get familiar with what all you can do with various UI elements.

UIView:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html

UIControl:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIControl_Class/Reference/Reference.html#//apple_ref/occ/cl/UIControl

UILabel:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILabel_Class/Reference/UILabel.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.