The following code example explain it with running code example.
//
// HelloArray.h
// DataTypes
//
//
#import <Foundation/Foundation.h>
@interface HelloArray : NSObject {
NSArray *arr;
}
@end
The implementation of the class is as follows:
//
// HelloArray.m
// DataTypes
//
//
#import "HelloArray.h"
@implementation HelloArray
-(void) print{
arr = [[NSArray alloc] initWithObjects:@"Me", @"Myself", @"I", @"and you", nil];
NSLog(@"The content of arry is%@",arr);
}
@end
The out put of the above example is:
The content of arry is(
Me,
Myself,
I,
"and you"
)
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.