7

これが私のviewcontroller.hファイルです:

#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

この線:

@property(nonatomic, retain) AVCaptureStillImageOutput *stillImageOutput;

次の問題が発生しています。

Expected ; at end of declaration list.

XcodeはAVCaptureStillImageOutputをクラスとして認識していません。これは、AVCaptureStillImageOutputが黒のままであり、タイプとして提案されていないためです。「Fix-it」は、;AVCaptureStillImageOutputの直後に挿入したいと考えています。

ただし、viewController.mファイルのviewDidLoadで宣言AVCaptureStillImageOutputをタイプとして使用しようとすると、それが認識され、タイプとして許可されます。また、残りのAVFoundationクラスは、そこのコードで認識されています。

フレームワークはそこにあります、私はこの@property宣言に問題があります。

4

2 に答える 2

7

あなたのラインで

@property(nonatomic, retain) AVCaptureStillImageOutput *stillImageOutput;

との間に見えない文字AVCaptureStillImageOutputがあり*stillImageOutputます。この行を vi エディターに貼り付けると、次のようになります。

@property(nonatomic, retain) AVCaptureStillImageOutput<feff><feff><feff><feff><feff> *stillImageOutput;

(U+FEFF は Unicode Byteorder マーカーであり、「Show Invisibles」がアクティブ化されていても、Xcode では通常のスペースのように見えます)。

スペースを削除して再挿入すると、問題が解決します。

于 2013-01-16T18:57:11.523 に答える
3

Editorメニューに移動し、を選択しますShow InvisiblesAVCaptureStillImageOutputとの間には、非表示で印刷できない文字がたくさんあることに注意してください*。これら2つの間のすべてを削除し、最後に1つのスペースを再度配置します。これらの非表示の文字は、印刷できませんが、クラス名の一部として使用されました。完了したら、もう一度選択できますHide Invisibles。コードをコピー/貼り付けするときは注意してください。これらの「不良文字」を上記のSO質問にコピー/貼り付けすることもできます。

于 2013-01-16T19:05:42.957 に答える