Xcode 4.2 is missing a .xib file? - iphone

So I'm pretty new to programming, so I downloaded Xcode 4.2 and got to work. I watched many online tutorials and the main problem I was having was that all the tutorials were for Xcode 4 and not 4.2, meaning when you chose empty application setting, it was missing the .xib file. So I found a tutorial on how to create a .xib file. I got through it all except for one step, and that was to drag the from the window outlet of the xAppdelegate to the window. I've tried this over and over, but it doesn't work.
Here is the tutorial if anyone needs to see it http://www.trappers.tk/site/2011/06/16/mainwindow-xib/
Please someone help me!

You need to hold Ctrl while dragging, else it will not work.
Guide.

As you Control-drag from an object to your source code, Interface Builder indicates where a new binding is valid. After you’ve made the connection, Xcode displays a dialog you use to configure the binding. You can use the dialog to configure all aspects of the binding.
Interface Builder uses the Xcode index to determine which key paths are valid, and can also discover what controller it should connect through—you can therefore connect from a user interface element such as a table column to a property in a model class header.
Check out the video here.

You should choose a SingleViewBased Application instead of Empty Application then study all files that how they connect with each other. You can choose Master Application also. They will help you.
see this Hello world Tutorial click me.
And Youtube is the best way to learning for beginners. Search tutorial video because action teach more than the text.

Related

Steps for internationalisation in Xcode

I've been trying to add a Portuguese translation to my app. At the moment it's all in English. (well, it started that way).
I'm using a Storyboard for the main part of the UI. There are also a couple of additional xib files for reusable UI in table etc...
Anyway, I set out on the path of trying to internationalise the app and managed to convert the Storyboard to Portuguese.
I then tried to set up some strings (just a couple to begin with) to make translations of those also.
I've now got an storyboard that's only in Portuguese (I lost the English version) and none of the strings are being translated properly anyway.
I've set all the string back to just use #"blah" now (I'd put NSLocalizedString in a couple of places).
So I should be back to square one (once I fix the storyboard).
Anyway, is there a list of steps somewhere of how to go about making an app localised?
Any help appreciated.
There are couple of tutorials available - this is one of the good ones: http://www.raywenderlich.com/2876/how-to-localize-an-iphone-app-tutorial
This will definitely help you to get started real quick!
However, if you are on iOS6 xCode 4.5 you should also check the new features regarding localization. Apple now has also gon the route to have just one XIB (not like before multiple XIBs, one per language - which was impossible to maintain)
Probably the most important point is to always use NSLocalizedString, so there is no need for multiple XIBs. And then it's real easy to just add a new strings file for each language.
All you have to do then is in the Project Editor select your project -> select the Info tab on the right -> scroll all the way down -> there you find the localizations, press the little + on the buttom to add a new language. That's it.

Cannot find window-based application on XCode

I am using XCode 4.2 and for some reason I cannot find the template for window-based application. Is there an extra step that I need to take here?
There is no longer a Window-based Application template starting from Xcode 4.2.
You have two other choices of "bare-bones" templates:
View-based Application template, which gives you a view on a storyboard to start with. It is similar to the one found in previous versions, except the view now resides on a storyboard which Xcode 4.2 makes use of.
Empty Application template, but you'll have to manually create and wire up a window nib file if you want to design your application in Interface Builder. It's nothing more than a trivial extra step, though.
If you can't make use of storyboards (e.g. to deploy to iOS 4 and earlier), you most likely need to go with the empty template. For the main window, just make a new Interface Builder file and assign it as your project target's Main Window.
Here are two very useful links:
The first one is a discussion on the Big Nerd Ranch forum where they discuss this issue - that the XCode 4.2 has done away with the Windows-template. They have a Template that you can use to add the "Windows-template" to your XCode installation. I have NOT tried this approach but you can try.
http://forums.bignerdranch.com/viewtopic.php?f=73&t=3336
As you dig through this thread - you will come on another site. This a blog post by Jeroen Trappers - on how to "manually" add the missing elements to an "Empty-application" template to make it "Window-template". I have followed these steps and they worked very well for me. In the process of going through these steps it does help you understand what is going on behind the scenes.Here is the URL to the post:
http://www.trappers.tk/site/2011/06/16/mainwindow-xib/
Window-based Application is now Empty Application. Just gives you an app delegate and a window. You build the rest.

Integrate auriotouch in another app

excuse me to create again this question, but I have another problem. I'm trying to integrate the aurioTouch Apple sample in my app. I have put all the code that was in aurioTouchAppDelegate in my app delegate file. The code runs, but some methods, like methods in EAGView file doesn't run, I don't know whym they are not called.
Some help or hints are welcome...
Have you integrate all the setting from Project's Build Settings. Actually I had the same issue but then I compare all the settings from Build Settings and found that some of the Linker flags were creating the problem and then was able to solve the problem. So whenever you have such problems try to go to Project's Build setting and compare all the keys. Mostly the Linker flags creates the problem in such cases.... hope this help to others also...
EDIT
After referring to your project. Notice that you have overloaded the property view of ViewController with your custom View EAGLView. You have not separated customView and ViewController's view.
Also, one major thing is you have to Initialize your EAGLView and add it to your ViewController's view. and rest of the things will go on in EAGLView.

IPhone App Build Successful But nothing shows

Very new to Iphone development here, I have a project which is successfully building (which is a first for me :) It loads the simulator but it just closes as soon as it loads, how can I debug this? It appears the Interface Builder xib files are not loading, I've added a xib thats from a hello world project, (they have different project names) Is this an issue?
Any advice would help,
Thanks!
You probably have an error in the Debugger Console. If it has to do with the XIB, it could be that you simply got the name wrong.
Another simple mistake is trying to use Outlets before viewDidLoad is called (for instance, in init).
In either case -- the message in the console will help.

MonoTouch and MVC - hook 2 Views to same Controller

I need to write an app that runs for iPhone and iPad.
The issue I'm running into is how do you setup an iPadView and an iPhoneView to hook to the same controller?
In other words, I don't want to have any duplicate controller code--I should only have to make a different view for each device.
Right now I link up view->controller by choosing "Add->New File->iPhone View with Controller", and this works for one device. But the code in the event handlers I have wired up should not have to be duplicated by going to "Add->New File->iPad View with Controller".
A link to a tutorial may help, I have been doing .Net Windows development for a while but still learning iPhone and MonoTouch.
This link talks about code generation for .xib files:
MonoTouch Doc
Apparently you can just delete your .xib.designer.cs file to turn off the code generation. Is this the right way to do it?
Otherwise I'll mark this as the answer.
Can you not just have a base controller and then inherit from that in both view controllers?