I need to deprecate a single method in objective-c protocol. On normal class/instance methods I add __attribute__ ((deprecated));
after declaration.
It seem
Apple deprecated some methods in the UITableViewDelegate protocol, perhaps you'll be able to find the solution using Apple's code as example.
The relevant code of the protocol is as follows:
- (UITableViewCellAccessoryType)tableView:(UITableView *)tableView
accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_0);
As you can see, Apple uses a macro. Perhaps this is the way to go?
EDIT: As noted on the following link [1] __attribute__((deprecated))
is a GCC construct so this might not work in LLVM. I guess this is the reason Apple uses macros, so some other (or no) deprecation construct will be called when other compilers are used.
[1] How to deprecate a method in Xcode