Can initWithFrame be used for custom tableviewcell after iPhone SDK 3.0?

It shows that initWithFrame is deprecated with initWithStyle in sdk3.0 and above.

But we can still use it without warning / error. So is it okay to continue using initWithFrame to implement the custom cell as a table?

Thank.

+2


source to share


2 answers


This is, in principle, normal. But it doesn't make sense for new code. The frame you pass to initWithFrame

does not actually affect the cell, which means that you must simply call initWithStyle:UITableViewCellStyleDefault

, which has the same result as initWithFrame:CGRectZero

.



In existing code, of course, it's okay to keep using it for a while initWithFrame

, but when you get a chance, you should change it to initWithStyle

. At some (unknown) point in the future, Apple will stop supporting the deprecated method, and your app will not create new releases of the iPhone OS if it uses the old methods.

+3


source


For a few more OS versions, this is normal. Like many legacy methods, as well as the Mac OS X sdk, it takes Apple some time (years?) To actually stop supporting them.



0


source







All Articles