标签在iOS 6中显示文本,但在iOS 7中不显示

时间:2014-03-25 18:48:01

标签: ios objective-c ios7 ios6 label

我有一个我的应用程序的视图,显示标签中的信息,问题是这个标签在iOS 7中是空的,但在iOS 6中工作正常,我无法找到原因。

这是用于获取视图控制器并显示数据的方法:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

ShoppeDetailViewController *detailViewController = [[ShoppeDetailViewController alloc] initWithNibName:@"ShoppeDetailViewController" bundle:nil];

PDLocation *pdLocationPhone = [self.locations objectAtIndex:indexPath.row];

detailViewController.phone = pdLocationPhone.telephone;
detailViewController.callMe = pdLocationPhone.callMe;

[self.navigationController pushViewController:detailViewController animated:YES];

PDLocation *pdLocation = [self.locations objectAtIndex:indexPath.row];
detailViewController.shoppeLabel.text = pdLocation.name;
detailViewController.addressLabel.text = pdLocation.description;

CLLocation *location = [[CLLocation alloc] initWithLatitude:pdLocation.location.latitude longitude:pdLocation.location.longitude];
CLLocationDistance distance = [_userLocation distanceFromLocation:location];
 if (distance < 0.1) {
 detailViewController.distanceLabel.text = [NSString stringWithFormat:@"Bienvenido"];
 } else {

     [detailViewController.distanceLabel setText:[NSString stringWithFormat:@"Estás a %.01f Km", distance/1000]];
 }

[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

我无法在iOS 7中运行任何想法?

谢谢!

这是XIB文件

XIB file showing label ubication

1 个答案:

答案 0 :(得分:0)

检查标签backgroundColortextColor。似乎这是一个颜色问题。