みたいなメニューがあります
選択ボタンしか表示されませんが、Hello 2を選択すると、Hello2ビューコントローラーが開きます。
私のコード:
enter code here
- (IBAction)selectClicked:(id)sender {
NSArray * arr = [[NSArray alloc] init];
arr = [NSArray arrayWithObjects:@"Hello 0", @"Hello 1", @"Hello 2", @"Hello 3", @"Hello 4", @"Hello 5", @"Hello 6", @"Hello 7", @"Hello 8", @"Hello 9",nil];
NSArray * arrImage = [[NSArray alloc] init];
arrImage = [NSArray arrayWithObjects:[UIImage imageNamed:@"apple.png"], [UIImage imageNamed:@"apple2.png"], [UIImage imageNamed:@"apple.png"], [UIImage imageNamed:@"apple2.png"], [UIImage imageNamed:@"apple.png"], [UIImage imageNamed:@"apple2.png"], [UIImage imageNamed:@"apple.png"], [UIImage imageNamed:@"apple2.png"], [UIImage imageNamed:@"apple.png"], [UIImage imageNamed:@"apple2.png"], nil];
if(dropDown == nil) {
CGFloat f = 200;
dropDown = [[NIDropDown alloc]showDropDown:sender :&f :arr :arrImage :@"down"];
dropDown.delegate = self;
}
else {
[dropDown hideDropDown:sender];
[self rel];
}
}
-(void)rel{
// [dropDown release];
dropDown = nil;
}