我有这段代码我希望它根据选定的数组文本获取标记值。从自定义类获取标记值
- (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