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

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

概述这是我的viewcontroller.h文件: #import <UIKit/UIKit.h>#import <CoreData/CoreData.h>#import <CoreLocation/CoreLocation.h>#import <AVFoundation/AVFoundation.h>#import <CoreMedia/CoreMedia.h>#import <Image 这是我的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”被激活也是如此).

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

总结

以上是内存溢出为你收集整理的objective-c – 错误:预期;在声明列表的末尾 – 类未被识别为类型全部内容,希望文章能够帮你解决objective-c – 错误:预期;在声明列表的末尾 – 类未被识别为类型所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1025166.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存