Showing posts with label iPhone. Show all posts
Showing posts with label iPhone. Show all posts

Thursday, July 23, 2009

Logging

Code to write application log in iPhone SDK / Cocoa using XCode :

NSLOG(@"log : %i", myIntVariable); //Log values of Integer variables
NSLOG(@"log : %f", myFloatVariable); //Log values of Float variables
NSLOG(@"log : %@", myStringVariable);//Log values of String variables

In XCode logging values can be viewed from Console window; it is availbale in XCode @ RUN --> CONSOLE.

--Mitesh Mehta
miteshvmehta@gmail.com

Alert Message

Code to showing Alert message with OK button using iPhone SDK / Cocoa programing:

UIAlertView *alert = [[UIAlertView Alloc]initWithTitle:nil message:@"An Alert message!" delegate:self cancelButtonTitle:"OK" otherButtonTitle:nil];
[alert show];
[alert release];

--Mitesh Mehta
miteshvmehta@gmail.com