Share on Google+Share on Google+

NSLog long example code

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

 

Advertisements

Posted on: July 29, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial 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.