BloodMagic
BloodMagic copied to clipboard
Not working for me.
My source: ` *.h file
import <Foundation/Foundation.h>
import "Presenter.h"
import "RubricMenuView.h"
import <BloodMagic/Lazy.h>
import "ProductCategoryIteractor.h"
@protocol RubricMenuView;
@interface RubricMenuPresenter : NSObject <Presenter, BMLazy>
@property (nonatomic, strong, bm_lazy) ProductCategoryIteractor* productCategoryIteractor;
- (instancetype) initWith: (id<RubricMenuView>) view;
@end
*.m file
import "RubricMenuPresenter.h"
@interface RubricMenuPresenter()
@property (weak) id<RubricMenuView> view;
@end
@implementation RubricMenuPresenter
@dynamic productCategoryIteractor;
pragma mark - RubricMenuPresenter methods
- (instancetype) initWith: (id<RubricMenuView>) view { self = [super init]; if (self) { self.view = view; } return self; }
pragma mark - Presenter methods
- (void) viewDidLoad { ProductCategoryIteractor* sdf = self.productCategoryIteractor; [[[sdf execute] subscribeOn: [RACScheduler mainThreadScheduler]] subscribeNext:^(id x) { NSLog(@"Log result"); } error:^(NSError *error) { NSLog(@"Log error"); }]; } `
When called line with source "ProductCategoryIteractor* sdf = self.productCategoryIteractor;" application is crashing with error "*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RubricMenuPresenter productCategoryIteractor]: unrecognized selector sent to instance 0x7fdfd51985a0'"
What I am doing wrong?