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
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.