我有這樣的方法:UIButton的目標:操作:選擇參數
- (void)retweet:(NSString *)idString {
STTwitterAPI *twitter;
[twitter postStatusRetweetWithID:idString successBlock:^(NSDictionary *status) {
UIAlertView *retweetSuccess = [[UIAlertView alloc]initWithTitle:@"Retweeted!" message:@"You have retweeted this tweet." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[retweetSuccess show];
} errorBlock:^(NSError *error){
}];
}
我也有我的tableview細胞的UIButton所以我用[cell.retweetButton addTarget:self action:@selector(retweet:)forControlEvents:UIControlEventTouchUpInside];
我如何用我的idString作爲參數方法參數與選擇器?
通過的UIButton稱爲選擇是一種'的 - (空)選擇:(UIButton的*)buttonReference'。你不能從中檢索一個'NSString'。 – 2015-03-03 13:26:26