Saturday, April 30, 2011

Use Three20 and UICatalog for the sample Code in iPhone SDK

Hello Friends,

I want to share one thing with you about sample code for the various functions. Most of us, try to find some basic code for the starting development of any kind of projects. So I recommend you to go with Apple's Development Guide. Friends, you can also register with apple on www.developer.apple.com without any cost. By registering your self with Apple you can download sample code of various functions of iOS SDK.

Three20 is a best example of use of various functions of iOS sdk. This can be found on GitHub. You can download such code and use it on different programs.

It can be found on this link: Three20 Catalog

You can also download UICatalog from Apple's Development site: UI Catalog

For example you can find various transitions methods that can be used for a slideshow in this examples.

  

Objective-C before you step into iPhone Development

Hello Friends,

Before you step into vast field on iOS development. You should be familiar with fundamentals of objective-C as I stated in my earlier post. Whole iOS is written in objective-C. If you are master in objective-C then you can directly start iPhone developing right away. If you are entering in iWorld first time then you should have cleared fundamentals of objective-C.

For the best practice of objective-C concepts, I recommend you following book for the depth and clear understanding.

You can buy this book from following link.
Objective C E-book

Or you can read whole book here also.



iPhone Programming Book and Guide

Hello Friends,

On the basis of my experience and knowledge, I want to share one E-Book for learning iPhone development which must be read by everyone who is entering in iOS world. This book is strongly recommended by me for the smooth learning.

Apress Beginning IPhone 4 Development



This is best book that I recommend to you for beginning development. All the programs are very well prepared and all chapters and languages are very coherent. If any body has any doubt regarding any program in this book, please post your questions here.

All the best. :-)  

Introduction of Navigation based Application in iPhone

In iPhone programming, navigation based application helps us to make application which contains many screens those should me connected to each other and they should be easily navigated to other screens. iOS sdk provides us Navigation Controller for make it easy.


Best primary example of navigation based application is Contact Application in iPhone. Such application can be started to build by selecting Navigation Based Application in Xcode.


When you create navigation based applications, you will find many files made by Xcode them self. Each file has its own importance. 


 You Should find following files after creating navigation application.


  • CoreGraphics.framework, Foundation.framwork, UIKit.framework - These are the basic libraries which are provided by apple. These library contains many functions as other languages.
  • HelloWorld.app -  This is an Application which will be installed in iPhone
  • Hello_World_Prefix.pch -   It contains some code to include the data inside the frameworks.
  • Hello_WorldAppDelegate.h -This is a header file that contains all of our definitions for variables.  It is very similar to a header file in other languages.
  • Hello_WorldAppDelegate.m -   This is first execution file which will be executed when program runs. The main .m file calls this object.
  • Info.plist - This contains various meta information about our program.  
  • main.m - Like most programming language, this file contains our main function. Execution begins from here.  The main function basically instantiates our object and starts the program.  We should not need to edit this file.
  • MainWindow.xib - This contains the visual information of  main window.  If we double click on it, it will open in a program called “Interface Builder”.
  • RootViewController.h, RootViewController.m - These are files for a view controller that gets added to our main window.  
  • RootViewController.xib - This is a display file which can be edited in interface builder.
We will write our main code of Hello World in Root View Controller.m file.
Open that file and write following code.


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *Identifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Identifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:Identifier] autorelease];
}
[cell setText:@"Hello World"];
// Set up the cell
return cell;
}


 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic
}


Save and Compile your program. Run the program in simulator. 

You should get following output.


Welcome to My Blog, We are starting with prerequisites for iPhone Development.


Hello Friends,
Good to see you on this blog. This is my first post on this iPhone Development blog.  Here now we are going to start iPhone development.
For the iPhone development you need following software.
  1.  iMac, Macbook or Macbook Pro
  2. Xcode with iOS sdk.
  3. SQLite Database.
  4. iPhone for the testing purpose.


For the iPhone development you need basic knowledge of the following skills.
  1. You must have strong knowledge of Object Oriented Programming.
  2. You must have knowledge of SQL. [At least you should know how to deal with database. You should  know how to throw query on database.]
  3. You should clear basics of objective-c. [You should be familiar with programming style of objective-c as iOS is written in objective-c.]


Now, we are going to write First program in Xcode.  We will start practicing with “Hello World!” program.