Home Tutorial Iphone Examples Nslog NSLog long example code

 
 

Share on Google+Share on Google+
NSLog long example code
Posted on: July 29, 2009 at 12:00 AM
Advertisement
In this example I will show you the usage of NSLog function to print the long value on the console.

The following code prints the long value on the console using the NSLog function.

//
//  PrintLong.h
//  DataTypes
//
// 

#import <Foundation/Foundation.h>  

@interface PrintLong : NSObject {

    long _long ;

}

-(void) print;

-(void) set_long: (long) n;

@end

The implementation of PrintLong class is as follows:

//

//  PrintLong.m

//  DataTypes

#import "PrintLong.h"  

@implementation PrintLong 

-(void) set_long: (long) n

{

    _long = n;

}

-(void) print

{ 

    NSLog(@"long value is: %i", _long);

}

@end

 

Advertisement

Related Tags for NSLog long 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