i have made an array and a dictionary. now i want to put the values of dictionary in to array.. i am very new to objective C so kindly help. "viewcontroller .m"
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
marray = [[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4", nil];
marray = [[NSMutableArray alloc]initWithObjects:@"6",@"7",@"8",@"9",@"10", nil];
[self displayarray];
[marray release];
mDictionary = [[NSMutableDictionary alloc]init];
[mDictionary setValue:@"sdfsdhfg" forKey:@"firstname"];
[mDictionary setValue:@"kvxv" forKey:@"lastname"];
[self displaydict];
[mDictionary release];
}
-(void)displaydict{
CFShow(mDictionary);
}
-(void)displayarray{
for (int i = 0; i<[marray count]; i++) {
NSLog(@"the array data present at %d index is %@",i,[marray objectAtIndex:i]);
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end