我有這段代碼我希望它根據選定的數組文本獲取標記值。從自定義類獲取標記值
- (IBAction)Share:(UIButton*)sender
{
menuItems =
@[
[KxMenuItem menuItem:@"Share"
image:nil
target:self
action:NULL],
[KxMenuItem menuItem:@"Share this on Facebook"
image:[UIImage imageNamed:@"facebook.png"]
target:self
action:@selector(pushMenuItem:)],
[KxMenuItem menuItem:@"Share this on Twitter"
image:[UIImage imageNamed:@"Twitter.png"]
target:self
action:@selector(pushMenuItem:)],
[KxMenuItem menuItem:@"Version 1.0"
image:nil
target:self
action:NULL],
];
first = menuItems[0];
first.foreColor = [UIColor colorWithRed:47/255.0f green:112/255.0f blue:225/255.0f alpha:1.0];
first.alignment = NSTextAlignmentCenter;
[KxMenu showMenuInView:self.view fromRect:sender.frame menuItems:menuItems];
}
- (void) pushMenuItem:(id)sender
{
NSLog(@"%@",sender);
}
我想要在發件人中獲取標記值。我如何設置標籤值到這個自定義彈出類。
這裏MenuItem
是陣列
檢查這個http://stackoverflow.com/questions/9146670/ios-uimenucontroller-uimenuitem-how-to-determine-item-selected-with-generic-sel/9874092#9874092可能是有幫助的ü ... – Kalpesh