Friday, April 20, 2012

Number 5: Accessing Properties In An Array of Objects To Display in UITableViews

Number 4: Navigating Between Views

For now, I am so glad that apple introduced storyboards.  It makes it super easy to navigate between views.

The other way is to get familiar with the different initial templates that Xcode provides when starting a new project.

Number 3: Passing Data Between Views and Objects

Learn the singleton design method to handle global variables.


Here is another tutorial that gives a quick introduction.
http://iphone.galloway.me.uk/iphone-sdktutorials/singleton-classes/

Number 2: Connecting IBOutlets & User Created Views To The Files Owner

Its easy to create a Objective-C Class for a UIViewController.  But how do you connect the darn thing so everything works.

Number 1: Dismissing The Keyboard after it appears

How To Dismiss the keyboard after it appears from clicking on a UITextField or UITextArea


Dismissing the keyboard was a central point of frustration for me once I began learning XCode and the Objective-C language.  The problem was that it is so easy to see the keyboard appear with that first HelloWorld, but infinitely frustrating because dismissing it takes a tab bit more knowledge.
The solution to dismiss the keyboard is in the following code:  resignTheFirstResponder.  Of course, I did not know what a firstResponder was and I certainly did not know how to resign it.  But, there are plenty of tutorials that simply said put this code block in the implemention file (the .m file), and magically the keyboard would disappear.  And sure enough it did, until I started trying to make my own UIViewControllers.
What will make your life easier is first putting in the delegate between the greater than less than signs <UITextFieldDelegate, UITextAreaDelegate> in the .h header file.  What this does is to inform XCode that you will want to use some of their code so that when you begin typing it will automatically suggest the code you with the correct syntax allowing you to avoide misspelling words.
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return NO;
}

I was very happy when this worked.  However, I remain frustrated that when I add this delegate information to a new viewController’s .h and .m files that the keyboard does not go away.  I can only guess that I do not have my connection right.  Perhaps someone, can outline the steps in the next section to create and connect a new viewcontroller to its class and IBOutlets so that the code to dismiss the keyboard is recognized.  At the time of  this writing, this is the number one issue that frustrated me as a new developer.  Not being able to dismiss the keyboard when using Storyboards, or when creating my own ViewController class.