我有一个菜单
它只显示选择按钮,但当我选择 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;
}