One option is to use the performSelector: withObject: function instead of calling the method directly. Therefore, instead of:
[Assert objectIsNotNil:object]
You may have:
[Assert performSelector:@selector(objectIsNotNil:) withObject:object]
This does not look so good, but it will remove the warnings. In addition, this template will work for any selector you want. To make things look a little better, you can use macros as follows:
#define ASSERT_PRECONDITION(sel, obj) [Assert performSelector:@selector(sel) withObject:obj]
So your assert will look like this:
ASSERT_PRECONDITION(objectIsNotNil:, object);
source share