alekseyn / EasyTableView

Horizontal and vertical scrolling table views for iOS
BSD 3-Clause "New" or "Revised" License
584 stars 157 forks source link

Unrecognized selector [EasyTableView viewAtIndexPath:indexPath]: #17

Closed MihalisL closed 12 years ago

MihalisL commented 12 years ago

Hi,

thanks for this wonderful project, you have made my life easier.

I have made a little demo using a horizontal EasyTableView which works fine on the simulator but crashes on calling viewAtIndexPath: on the EasyTableView using an ipod touch (latest gen) device. The message I get is:

'NSInvalidArgumentException', reason: '-[EasyTableView viewAtIndexPath:]: unrecognized selector sent to instance...

I have checked and the reference to the EasyTableView is correct.

I used to have the same issue on the simulator but ever since updating to the latest (March 1st, non-ARC) version, it worked fine on the simulator. Any ideas of what could be wrong or what I might be doing wrong?

Thanks in advance,

Michail

alekseyn commented 12 years ago

Either the object you are sending the message to is not really an EasyTableView, or EasyTableView has not been properly retained and you are dealing with a zombie object (it used to be there, but is no longer there). Your problem is related to improper memory management somewhere in your code.

Even if you have an existing project, I recommend using the ARC version of EasyTableView so that you don't get bitten by memory management issues. Last week I converted a 10,000+ lines-of-code project over to ARC and the conversion went as smooth as silk. ARC is a beautiful thing:-)

MihalisL commented 12 years ago

Many thanks Aleksey!

I have used the ARC version and did some DIY to ARC convert my project and it worked like a charm! I was a bit skeptical of using ARC in the first place. Hopefully it will run on 4.3 as well...