我是iOS开发的新手,
我想在我的应用程序中画一条线,我创建了一个简单的基于视图的应用程序,
我知道要画线我们需要- (void)drawRect:(CGRect)rect
方法,但是这个方法在UIView
not in
UIViewCOntroller
如何将我的班级更改为UIView
?
这是我的代码片段,
// .h file
@interface Financial_Calc : UIViewController{
UIButton *firstBtn,*secondBtn;
}
@end
//.m file
@implementation Financial_CalculatorViewController
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)drawRect:(CGRect)rect {
NSLog(@"drawRect");
}
@end
任何帮助将不胜感激