try to call drawRect of subView for changing it but get runtime error <p>I want to draw some lines after some events happened on my main View but I'll get some runtime error says :</p> <blockquote> <p>-[subView setNeedsDisplay:]: unrecognized selector sent to instance 0x4b03460 2011-11-09 18:32:33.209 testSubView[53131:40b] <em>*</em> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[subView setNeedsDisplay:]: unrecognized selector sent to instance 0x4b03460'</p> </blockquote> <p>and this is what I have done : </p> <p>create a subview.h/m then import subview.h inside my viewcontroller</p> <p>and this is my viewcontroller code :</p> <pre><code>subView * sb; -(void) viewDidLoad { CGRect subviewRect = CGRectMake(0, 0, 320, 320); sb = [[[subView alloc] initWithFrame:subviewRect] retain]; [sb setBackgroundColor:[UIColor whiteColor]]; [self.view addSubview:sb]; } -(IBAction) slidingN : (UISlider *) sender { NSLog(@"slider called"); NSLog(@"%d" , (int)sliderN.value); [sb setNeedsDisplay:YES]; } </code></pre> <p>please let me know what exactly my problem is.</p>