for this line:
[UISwitch setOn:YES animated:YES];
Xcode gives me a warning “class method not found (return type defaults to ‘id’).”
When I click on setOn or animated, the utilities pane recognizes it and says its declared in UIKit/UISwitch.h
UIKit is in my frameworks folder. I imported the .h to the .m like this:
#import "UIKit/UISwitch.h"
When I run, the main function receives “SIGABRT”
But when I remove that line above, no problems.
This is because
setOn:animatedis not a class method. It is an instance method. You have to call this on an instance ofUISwitch. For example: