Home Tutorial Iphone Examples Nslog NSLog print NSString example code

 
 

Share on Google+Share on Google+
NSLog print NSString example code
Posted on: July 29, 2009 at 12:00 AM
Advertisement
In this example we will show you the code to print the NSString using NSLog function.

Following example prints the value of NSString object on the console using the NSLog function which can be used to debug the iPhone application.

//
//  printString.h
//  DataTypes
//
// 

#import <Foundation/Foundation.h>  

@interface printString : NSObject

{

    NSString *string;   

}

-(void) print; 

@end

The implementation class code is as follows:

//
//  printString.m
//  DataTypes
//

#import "printString.h"

@implementation printString

-(void) print

{

    string= @"Welcome in Programming";

    NSLog(@"process Name: %@ Process ID: %d",string);

}

@end

 

Advertisement

Related Tags for NSLog print NSString example code:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 29, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com