配列と辞書を作成しました。今、私は辞書の値を配列に入れたいと思っています..私は目的のCに非常に慣れていないので、親切に助けてください。「ビューコントローラー.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