Objective C : Given a Class id, can I check if this class implements a certain protocol? Or has a certain selector?

NSString *className; //assume this exists
Class class = NSClassFromString(className);
if ([class conformsToProtocol:@protocol(SomeProtocol)]) {
    id instance = [[class alloc] init];
    [instance create];
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)