Hi,
It is shown that initWithFrame is deprecated with initWithStyle in sdk3.0 and above.
But we can still use it without any warning/error. So is it ok to continue using initWithFrame for implementing custom cell in tableview?
Thank You.
Hi,
It is shown that initWithFrame is deprecated with initWithStyle in sdk3.0 and above.
But we can still use it without any warning/error. So is it ok to continue using initWithFrame for implementing custom cell in tableview?
Thank You.
For a few more OS releases it is OK. Like many deprecated methods and those in the Mac OS X sdk, it takes Apple some time (years?) to actually stop supporting them.
It is, in principle, ok. But it doesn't really make sense for new code to do this. The frame you pass to initWithFrame
doesn't really influence the cell anyway, which means you should just call initWithStyle:UITableViewCellStyleDefault
, which has the same result as initWithFrame:CGRectZero
.
In existing code, it is of course ok for some time to keep using initWithFrame
, but when you get the chance, you should change it to initWithStyle
. At some (unknown) point in the future, Apple will stop supporting the deprecated method, and your app won't build with new iPhone OS releases if it uses old methods.