Home Tutorial Iphone Examples Nslog Printing the String value using NSLog function

 
 

Share on Google+Share on Google+
Printing the String value using NSLog function
Posted on: July 29, 2009 at 12:00 AM
Advertisement
In this section you will learn how you can print the value of NSString using the NSLog function.

In this section you will learn how you can print the value of NSString using the NSLog function.

In the following code example we will show you how you can easily output the value of NSString variable using the NSLog function.

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

#import <Foundation/Foundation.h>  

@interface printString : NSObject

{

    NSString *string;   

}

-(void) print; 

@end

and the code of implementation class 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 Printing the String value using NSLog function:


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