Hi Guys,
Back again as you were really helpful last time
Im following a tutorial on creating a whiteboard drawing app, but everytime i insert a certain piece of code it crashes the app when i go to the settings button.
This is the code:
.h
flipsideviewcontroller.m
The tutorial is here:
Back again as you were really helpful last time
Im following a tutorial on creating a whiteboard drawing app, but everytime i insert a certain piece of code it crashes the app when i go to the settings button.
This is the code:
.h
Code:
//
// FlipsideViewController.h
// SampleBrushes
//
// Created by Andrea Busi on 01/03/10.
// Copyright BubiDevs 2010. All rights reserved.
//
@protocol FlipsideViewControllerDelegate;
@interface FlipsideViewController : UIViewController {
id <FlipsideViewControllerDelegate> delegate;
IBOutlet UISlider *sliderRed, *sliderBlue, *sliderGreen, *sliderBlack, *sliderDimension;
IBOutlet UIImageView *viewColour;
IBOutlet UILabel *labelDimension;
UIColor *penColour;
float penDimension;
}
@property (nonatomic, assign) id <FlipsideViewControllerDelegate> delegate;
@property (nonatomic, assign) UIColor *penColour;
@property (nonatomic, assign) float penDimension;
- (IBAction)done;
- (IBAction)changeColour;
- (IBAction)changeDimension;
@end
@protocol FlipsideViewControllerDelegate
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller newColour:(UIColor*)colore newDimension:(float)dimension;
@end
flipsideviewcontroller.m
Code:
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
const CGFloat *components = CGColorGetComponents([colorePennello CGColor]);
[sliderRed setValue:components[0]];
[sliderGreen setValue:components[1]];
[sliderBlue setValue:components[2]];
[sliderBlack setValue:components[3]];
[viewColore setBackgroundColor:colorePennello];
labelDimensione.text = [NSString stringWithFormat:@"%f",dimensionePennello];
[sliderDimensione setValue:dimensionePennello];
}
The tutorial is here: