0
有誰知道如何在tableview腳本下實現這些按鈕,然後保存它和retreive解析?贊和評論按鈕,然後保存它來解析
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
NSString *[email protected]"footer";
UITableViewCell *footer = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
UIView* FView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 100.0)];
UIButton *like = (UIButton *)[footer viewWithTag:1];
[button addTarget:self action:@selector(buttonwastapped:) forControlEvents:UIControlEventTouchUpInside];
[FView addSubview:self.like];
return [FView autorelease];
}
- (void)buttonwastapped:(UIButton*)sender
{
PFUser *user = [PFUser currentUser];
PFRelation *relation = [user relationForKey:@"likes"];
[relation addObject:post];
[user saveInBackground];
} //i try to use that but nothing happened
頁腳中的按鈕?如果是這樣,是'buttonwastapped:'當選擇該按鈕時被調用? – 2014-09-22 01:26:57
是啊,它被稱爲 – 2014-09-23 01:32:49