如何让UILabel回应IBAction?

时间:2011-11-08 05:47:52

标签: iphone uitableview uilabel customization nib

我已经定制了UITableViewCell(从nib加载的静态内容)。这个单元格包含一个UILable,我想在用户点击它时更改其值。 (将显示PickerView,并且该用户可以为该标签选择值。)

所以我创建了以下IBAction。但是,当我尝试将其与UIlable连接时,它不允许我这样做。

-(IBAction)selectlanguage:(UILabel *)sender
{
/*
 Code to display pickerview and select appropriate language
 */

self.languageLable.text=@"Spanish";

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.userTranslationLanuage = @"en|sp";
}

有谁能告诉我我错过了什么?

萨米特

1 个答案:

答案 0 :(得分:5)

只需在连接到此IBAction的标签上放置一个隐形按钮。 UILabel对象无意直接响应用户触摸。

相关问题