I have this code which created with UITableView and making the cell’s color show alternatively white and grey. 
How can I correct this, without memory leak? Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your code is:
This leaks the
UIImageView. You allocated it, but you didn’t release it afterwards.To fix:
The arrows in the analyzer warning are a little misleading — they’re trying to show the flow of the execution through the code, into the method that caused the leak, and then out. The textual messages are the important part.
(Also, I suspect you want
tbl_RowIndex1 % 2, nottbl_RowIndex1 %= 2.)