小编ED.*_*ED.的帖子

UITableView didSelectRowAtIndexPath调用两次

在某些情况下,UITableView didSelectRowAtIndexPath被调用两次导致错误Pushing the same view controller instance more than once is not supported.

以下是事件的顺序:

TableView::didSelectRowAtIndexPath.  
TableView::viewWillDisappear.  
PushedViewController::viewWillAppear.  
TableView::didSelectRowAtIndexPath.  
Error: Pushing the same view controller instance more than once is not supported'  
Run Code Online (Sandbox Code Playgroud)

唯一值得注意的是,UITableView是异步加载图像,但从不调用didSelectRowAtIndexPath.此外,PushedViewController被重用,以避免每次在UITableView中选择单元格时重新加载它.

任何人都知道这可能导致什么?谢谢.

iphone tableview didselectrowatindexpath

18
推荐指数
2
解决办法
6271
查看次数

UIMarkupTextPrintFormatter在页面底部留下2-3英寸的空白区域

尝试使用打印包含表格的html页面UIMarkupTextPrintFormatter.出于某些奇怪的原因,当第一页上有足够的空间(2-3英寸)时,最后一行被推到第二页.更糟糕的是,当我从html表中删除最后一行时,现在的最后一行(比删除的一行长几英寸)在第1页和第2页之间分开,当它在删除行之前明显适合第1页时.页眉和页脚高度都设置为零.插图也为零.当使用UIWebView并使用打印时,相同的html完全适合1页. UIViewPrintFormatter *formatter = [webview viewPrintFormatter]; 但这需要显示UIWebView(因此它被渲染),我不想这样做.

非常感谢对此的任何见解.

html printing iphone ios airprint

5
推荐指数
1
解决办法
782
查看次数