Is there a way to ask the compiler if ARC is turned on, and then conditionally compile based upon that value? For example, I have a protocol:
@protocol ProtocolA
@required
-(void)protocolMethodOne
@optional
-(void)protocolMethodTwo;
@end
If I'm using ARC, I would like to make protocolMethodA
optional when using ARC, and required when not using ARC. This is because one of the main reasons for utilizing this method is to dealloc the object instance.
With that said, here's what I would like to happen:
@protocol ProtocolA
#ifdef SOME_ARC_VARIABLE
@optional
#else
@required
#endif
-(void)protocolMethodOne
@optional
-(void)protocolMethodTwo;
@end