Getting 3 warnings when using PickerView
When I use this code I get three warning at the implementation saying that
incomplete implementation,Method
pageViewController:viewControllerAfterViewController in protocool not
implemented, Method pageViewController:viewControllerBeforeViewController
in protocool not implemented. I do not know why this is happening
This is my header file
IBOutlet UIPickerView *SaveTopicker;
NSMutableArray *arraygenre;
}
@property(nonatomic, retain) AVCaptureStillImageOutput *stillImageOutput;
@property (weak, nonatomic) IBOutlet UILabel *categoryLabel;
@property (weak, nonatomic) IBOutlet UIView *imagePreview;
@property (weak, nonatomic) IBOutlet UIView *saveImage;
@property (weak, nonatomic) IBOutlet UIImageView *captureImage;
@property (weak, nonatomic) IBOutlet UISegmentedControl *cameraSwitch;
@property (weak, nonatomic) IBOutlet UIView *pickerViewContainer;
@property (nonatomic, retain) UIAccelerometer *accelerometer;
@property (weak,nonatomic) IBOutlet UIScrollView *BGScrollView;
- (IBAction)saveButton:(id)sender;
- (IBAction)closeButton:(id)sender;
@property (retain, nonatomic) UIImage *yourImage;
- (IBAction)switchCamera:(id)sender;
- (IBAction)snapImage:(id)sender;
@end
This is my implementaion file.
@implementation ViewController
@synthesize accelerometer, stillImageOutput, imagePreview, captureImage,
cameraSwitch, pickerViewContainer;
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
return 1;
}
- (NSInteger)pickerView:(UIPickerView *)thePickerView
numberOfRowsInComponent:(NSInteger)component {
if (component == genre)
return [arraygenre count];
return 0;
}
- (NSString *)pickerView:(UIPickerView *)thePickerView
titleForRow:(NSInteger)row forComponent:(NSInteger)component {
if (component == genre)
return [arraygenre objectAtIndex:row];
return 0;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle
*)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (IBAction)saveButton:(id)sender {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
pickerViewContainer.frame = CGRectMake(0, 307, 320, 261);
[UIView commitAnimations];
}
- (IBAction)closeButton:(id)sender {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
pickerViewContainer.frame = CGRectMake(0, 460, 320, 261);
[UIView commitAnimations];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component{
NSArray *paths =
NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//fetch Category Name from the array used to fill the Picker View
NSString *categoryName= [arraygenre objectAtIndex:row];
NSString *fPath = [documentsDirectory
stringByAppendingPathComponent:categoryName];
NSFileManager *fileManager=[[NSFileManager alloc]init];
[fileManager createDirectoryAtPath:fPath
withIntermediateDirectories:YES attributes:nil error:nil];
UIImage *image = captureImage.image;
NSData *data = UIImagePNGRepresentation(image);
[data writeToFile:fPath atomically:YES];
}
No comments:
Post a Comment