您是否知道NSError在实例化之后是否有一种很好的方法来设置/修改localgedcription,而不是重新创建它?我没找到任何.
我无法隐藏我的UITableView页脚(即将其高度设置为0并为过渡设置动画).
我试图在tableView.tableViewFooter.height = 0(和tableView.tableViewFooter = nil)之间包装[tableView beginUpdates],[tableView endUpdates]但它不起作用.
实现下面的方法会创建另一个页脚.
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 50;
}
Run Code Online (Sandbox Code Playgroud)

tableview页脚和章节页脚之间有区别吗?我在我的故事板中的桌面视图下面放了一个按钮,创建了我的.
有什么想法吗?
我的应用程序包含一个UITableView部分页脚.当用户滚动到tableView的底部时,有时在最后一个单元格和tableFooter之间会出现分隔符插入.此行为不一致.


有没有办法强制此分隔符始终显示或永远不会出现?你们有没有注意到这种不一致的行为?对我来说似乎是一个错误.
编辑
我正在使用
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UILabel *footer = [[UILabel alloc] init];
footer.backgroundColor = [UIColor whiteColor];
footer.font = [footer.font fontWithSize:15];
footer.textAlignment = NSTextAlignmentCenter;
return footer;
}
Run Code Online (Sandbox Code Playgroud)
但你只能使用它轻松重现同样的问题
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;
Run Code Online (Sandbox Code Playgroud)


我正试图解析NSString一个NSNumberFormatter像下面这样的人.
NSNumberFormatter *myFormatter = [[[NSNumberFormatter alloc] init];
NSNumber *myNumber = [myFormatter numberFromString:@"42.00000"];
Run Code Online (Sandbox Code Playgroud)
numberFromString返回NSNumber模拟器中的对象,但不返回设备上的对象.
小数(.00000)导致设备上的返回值为零,因为解析42(没有小数)工作正常(在模拟器和设备上).
我使用NSNumberFormatter的原因是因为nil如果字符串不是有效数字(它在这里对我不利,那就是它返回的方式:p).NSString doubleValue不提供这种行为.此外,NSDecimalNumber decimalNumberWithString由于[NSDecimalNumber decimalNumberWithString:@"4a2.00000"]返回4 ,因此无法完成工作.
任何想法为什么这不适用于设备?
这是现场吗?我尝试过设置myFormatter.numberStyle = NSNumberFormatterNoStyle,NSNumberFormatterDecimalStyle但它什么都没改变.