Here is my viewcontroller.h file:
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import <CoreLocation/CoreLocation.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreMedia/CoreMedia.h>
#import <ImageIO/ImageIO.h>
#import <CoreVideo/CoreVideo.h>
@interface ViewController : UIViewController <UINavigationControllerDelegate, CLLocationManagerDelegate>
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
@property(nonatomic, weak) IBOutlet UIImageView *selectedImageView;
@property(nonatomic, retain) IBOutlet UIImageView *vImage;
@property(nonatomic, retain) AVCaptureStillImageOutput *stillImageOutput;
- (IBAction)photoFromAlbum;
- (IBAction)photoFromCamera;
- (IBAction)saveImageToAlbum;
- (IBAction)segueToChoosePhotoTypeViewController;
@end
The line:
@property(nonatomic, retain) AVCaptureStillImageOutput *stillImageOutput;
is generating the following issue:
Expected ; at end of declaration list.
Xcode isn't recognizing AVCaptureStillImageOutput as a class as it remains black and doesn't suggest it as a type, and the "Fix-it" wants to insert the ;
right after AVCaptureStillImageOutput.
However, if I try to use declare AVCaptureStillImageOutput as a type in viewDidLoad of my viewController.m file, it recognizes it and allows it as a type. Also, the rest of the AVFoundation classes are being recognized in the code there.
The framework is there, I'm just having an issue with this @property
declaration.
In your line
@property(nonatomic, retain) AVCaptureStillImageOutput *stillImageOutput;
you have some invisible characters between AVCaptureStillImageOutput
and *stillImageOutput
. If I paste this line into the vi editor, it looks like this:
@property(nonatomic, retain) AVCaptureStillImageOutput<feff><feff><feff><feff><feff> *stillImageOutput;
(U+FEFF is a Unicode Byteorder marker, and it looks like a normal space in Xcode, even if "Show Invisibles" is activated).
Deleting and re-inserting the space fixes the problem.
Go to the Editor
menu, select Show Invisibles
. Note that you have plenty of invisible, non printable characters between the AVCaptureStillImageOutput
and the *
. Delete everything between these two and finally put there a single space again. Those invisible characters, even though not printable, were taken as part of your class name. Once you are done, you can select Hide Invisibles
again. Be careful when copy/pasting code, you even copy/pasted those "bad characters" into your SO question above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With