iPhone Programming ... First Step

I was reading the previous days about programming using Objective C and how to make iPhone applications. Yesterday I had the first step of creating a simple application. I made a simple application to get a name and display it on a label. And selecting a value from a segment and display it and checking a slide value when moving it.

The main idea in using xCode is to use the MVC. Easily you can design the interface using drag and drop, and then you need to add some code for the controller (view controller).

First we need to define the elements, and we should use: IBOutlet to define any element, so we can connect it to the view (user interface).

So for example

IBOutlet UILabel *myLabel;
IBOutlet UITextField *myTextField;

This should be defined at the header file first (.h), and then implemented in the (.m) implementation file.

The functions should be defined using IBAction
Example:
-(IBAction) setLabelValue:(id) sender
we can use id in case we don't know the type of the object, or when we need to know the type of object (int,float,double,date ... etc.)

Full project is available to download at:
First iPhone test application

How to declare a constant in Java?

The statement of declaring a constant in Java is final

Code:

final static double PI = 3.14;
final int DAY = 24;

PLEASE note that the constant name should be in CAPITAL LETTERS.

Adding Categories to Blogspot Blogger

I was searching how to add categories to my blog in blogspot and I found this great article. Its all about using labels and then adding a side gadget to list these labels (categories) and even the number of posts in them.

http://interestingwebs.blogspot.com/2008/11/adding-categories-to-blogspot-blogger.html

Starting Java

This is my first post about Java programming language, I'll start this post with variables and how to declare them.

int i;
int i,j,k;
int m = 1, s = 2, k = 40;

float r;
double w = 2.5;

String myString = "Hello";
String mySt = 'This is wrong'; // Wrong declaration of String ... it should be with double qoute

Blog for life!

Hey!
I have started this blog to jot my daily programming activities and adding some codes and tutorials in using programming languages like java, python,php and soon with Object-C as I'm going to learn it for iPhone development.