iOS開發筆記 tableview重用問題

2021-07-09 15:38:37 字數 540 閱讀 3845

前陣子載入系統內建相簿,發現相簿多了以後,拉動table,很多都會出現重複的現象,排查**發現,自己在cellforrowatindexpath裡面,每次都會alloc一次顯示的imageview,不去判斷這個imageview是否存在。只需要先判斷一下這個imageview是否已經存在。講得不到位的地方歡迎指正。

下面**是加在cellforrowatindexpath裡面的。

[objc]view plain

copy

uiimageview

*showimage = (

uiimageview

*)[cell

.contentview

viewwithtag:8

88]; //先將cell.contentview裡面tag為888的view賦給showimage

if(!showimage)   

showimage.image

= [uiimage

imagewithcgimage

:image];  

iOS開發筆記

1.預設快取策略下 useprotocolcachepolicy 對於靜態資源的訪問,請求頭會自動帶上 if none match if modified since 快取方面,響應頭帶有 last modified etag 兩個字段 儘管charles抓包結果為304,但是 urlsession...

ios開發筆記 4

title ios開發筆記 4 date 2016 02 21 01 11 55 categories ios tags ios,筆記 一般此問題 都是由inte ce build與 中iboutlet的連線所引起的。可能是在 中對iboutlet的名稱進行了修改,導致inte ce build中的...

我的ios開發筆記

這個星期開始學習 ios開發 由於本人記性不好 將知識點在這篇文章做乙個備忘 以下是網路上摘錄知識點的索引。json 我用的是jsonkit property synthesize property是乙個屬性訪問宣告,擴號內支援以下幾個屬性 1,getter gettername,setter se...