簡體   English   中英

'tableView:heightForFooterInSection' 實現中的返回類型沖突:'CGFloat'(又名'double')與'float')

[英]conflicting return type in implementation of 'tableView:heightForFooterInSection': 'CGFloat' (aka 'double') vs 'float')

我有以下錯誤代碼,如上面的主題

-(float) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 150.0f; }

感謝對此的修復,

謝謝

您應該刪除f並返回150.0
因為當您在最后添加f時,它會創建一個浮點數,而您想要返回一個雙精度數。 並且因為方法簽名應該是-(CGFloat)而不是-(float)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM