The initWithFrame:reuseIdentifier: method has been deprecated since 3.0 two years ago. Are you just now receiving this warning?
Yes, which doesn't make sense, as I've been using Xcode 4 for awhile now with the latest 4 SDK.
You could have turned off the warnings for deprecated methods a while back and then it somehow got turned back on when you upgraded Xcode. Just a possibility.
Oh, I see, so how would I fix this warning? My apps have been working fine on iPads running the iOS 5 beta, but the deprecation scares me. Thanks in advance![]()
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Standard"];
if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Standard"] autorelease]
I would use something like this:
Code:UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Standard"]; if (cell == nil) cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Standard"] autorelease]
(You can still use cell identifiers and such, I just prefer using strings.)
I'm still only using Xcode 4.1 and the newest version of iOS 4 (4.3.5? Something like that...) though, so maybe this has been deprecated since and I just haven't heard yet.
There was a bug with deprecation warnings not showing for methods that return id, like init methods. I know the method under discussion didn't generate warnings for a long time.
OP, if you look at the header file that contains the method that has been deprecated you should be able to find out how you fix the problem. Also if you look at the reference docs for the relevant class you should find the method marked as deprecated and instructions on how to fix the issue.
I looked at the documentation here: http://developer.apple.com/library/...ITableViewCell/initWithStyle:reuseIdentifier:
Which is what I'm supposed to use now, but I can't figure out how to make it work with my existing code.![]()
Did the code I provided a few posts ago not work?
I checked and the code I gave works on iOS versions as old as iOS 3, which if I'm not mistaken, will run on every iOS device ever made.