I'm trying to get Facebook Connect functionality working in my iPhone app. I'm wondering how to get the button lined up correctly in my UITableView:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if (indexPath.section == 0){
if (indexPath.row == 0){
}
}
if (indexPath.section == 1){
if (indexPath.row == 0){
cell.textLabel.text = @"Connect with Facebook";
cell.accessoryView = login;
}
}
return cell;
I've tried using the accessoryView, but it turns out like this:
Also the button only appears when if I tap on the cell.
Please help if you can!
Thanks.