I have something like this:
// main.m
@interface MYView : UIView { @public int counter; } @end;
@implementation MYView
- (void)drawRect:(CGRect)rect {
}
@end
now I would like to remove drawRect method (or any other method) from implementation here, and move it to C++ file utility.cpp.
The reason why I need this, is that I must use some C++ library, that will not compile in Objective-C++. And I need to use that library intensively so that just switching back and forth is not convenient.
I know I can simly do this:
- (void)drawRect:(CGRect)rect {
call_cpp_function(rect);
}
but maybe I can just completely define the method in c++? Something like this:
void __magic_declaration__ MYView::drawRect(CPPTYPE(CGRect))
// note, this line is completely my own imagination, this is just to illustrate what I want.