加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – 错误:预期;在声明列表的末尾 – 类未被识别为类

发布时间:2020-12-14 17:59:04 所属栏目:百科 来源:网络整理
导读:这是我的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@interf
这是我的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识别为类,因为它仍然是黑色并且不建议它作为类型,并且“Fix-it”想要插入;就在AVCaptureStillImageOutput之后.

但是,如果我尝试使用声明AVCaptureStillImageOutput作为我的viewController.m文件的viewDidLoad中的类型,它会识别它并允许它作为类型.此外,其余的AVFoundation类在那里的代码中被识别.

框架在那里,我只是遇到了这个@property声明的问题.

解决方法

在你的行

@property(nonatomic,retain) AVCaptureStillImageOutput *stillImageOutput;

AVCaptureStillImageOutput和* stillImageOutput之间有一些不可见的字符.如果我将此行粘贴到vi编辑器中,它看起来像这样:

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

(U FEFF是一个Unicode Byteorder标记,它看起来像Xcode中的普通空间,即使“Show Invisibles”被激活也是如此).

删除并重新插入空间可以解决问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读