I have been using CPLockController Class happily for quite a while. But since upgraded to Xcode 4.2, I have been getting the following warning:
'CPLockController' may not respond to 'initWithStyle:'
wherever this line is in the code:
CPLockController *lockController = [[CPLockController alloc]initWithStyle:(UITableViewStyle)CPLockControllerTypeAuth];
The implementation in CPLockController.m file is:
- (id)initWithStyle:(CPLockControllerStyle)theStyle {
if(self == [super init]){
self.style = theStyle;
self.retry = NO;
self.tempString = [NSMutableString string];
self.hideCode = YES;
}
return self;
}
and type definition of CPLockControllerStyle:
typedef enum {
CPLockControllerTypeAuth,
CPLockControllerTypeSet
} CPLockControllerStyle;
I even created an issue in github, but no reply up till now!
Please guide… thanks!
That’s because the developer hasn’t declared
-initWithStyle:in the class declaration. If you inspect CPLockController.h,-initWithStyle:is not there.I’m not sure why the developer hasn’t done this (maybe he’s forgotten it, in which case you should file a bug), but you can easily add the declaration to CPLockController.h as follows: