Reputation: 17364
I have a strange behavior with Xcode (4.3.2) and deprecated warnings, I would like to understand why. It seems that the deprecated warnings are triggered only on certain methods. For example (both methods are deprecated):
[[UITableViewCell alloc] initWithFrame:CGRectMake(0, 0, 0, 0) reuseIdentifier:@"Cell"];
The compiler warn (Correctly) that the method is deprecated. But:
[self presentModalViewController:viewController animated:YES];
doesn't trigger the warning. Why? :-)
Upvotes: 0
Views: 467
Reputation: 11839
Check in the developer docs, you will get like -
1- It is deprecated currently-
// Frame is ignored. The size will be specified by the table view width and row height.
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_0);
2- It will be deprecated soon.
// Display another view controller as a modal child. Uses a vertical sheet transition if animated.This method has been replaced by presentViewController:animated:completion:
// It will be DEPRECATED, plan accordingly.
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;
Hope it clears why you are getting warning in first, not in second.
Upvotes: 1