Home Tutorial Iphone Examples Nslog NSLog long example code

 
 

NSLog long example code
Posted on: July 29, 2009 at 12:00 AM
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

 

Related Tags for NSLog long example code:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.