i am sure this is a very nooby question but i can not find it anywhere on the internet, or maybe am looking wrong but.
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
{
//how do i fit this code--> idUIAccelerometerDelegate
//into the interface where it is the only place it can work?
IBOutlet UIImageView *imageView;
UIImage *image;
UIImagePickerController *imagePicker;
UIImagePickerController *imagePicker2;
//the code above is already linked with the @interface at the top thingy.
//but now i also want to link the @accelerometer but it won't let me without any errors.
float valueX;
float valueY;
}
@property (nanotomic,strong) IBOutlet UIButton *snow;
-(void)awakeAccelerometer;
-(void)acc
- (IBAction)takePhoto;
- (IBAction)chooseExisting;
@end
thank you for any help sorry if i wasted your time. down vote me by all means if you wish to.
I believe you are wanting your object to receive the messages from the accelerometer, If that is true then you dont want to add a delegate, you want to become the delegate.
your class will Conform the the UIAccelerometerDelegate much like it does the UIImagePickerControllerDelegate and the UINavigationControllerDelegate and will look something like this
and you would add the following function to your class
Be aware that this method is deprecated in ios 5, and now you should look into Core Motion. This should work on ios 6 still, but its a good possibility it will go away in the near future.