Call resolveInstanceMethod for Swift NSObject class

Hello!

Is it possible to call resolveInstanceMethod of SomeClass for such code?

let someInstance = SomeClass1()
someInstance.temp = NSNumber(0)

where

@objcMembers
class SomeClass1: SomeClass {
    dynamic var temp = NSNumber(1)
}

@interface SomeClass : NSObject

@property(nonatomic, retain) NSNumber *sample;

@end

@implementation SomeClass
@dynamic sample;

+ (BOOL)resolveInstanceMethod:(SEL)sel
{
    NSLog(@"resolveInstanceMethod");
    return YES;
}
@end

this code works for

let someInstance = SomeClass()
someInstance.sample = NSNumber(0)

but crashes for

let someInstance = SomeClass1()
someInstance.sample = NSNumber(0)
Terms of Service

Privacy Policy

Cookie Policy