OGeek|极客世界-中国程序员成长平台

标题: ios - 在 .h 文件中声明 NSString - objective-c [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 04:09
标题: ios - 在 .h 文件中声明 NSString - objective-c

这听起来像是一个愚蠢的问题,但我无法在网上轻松找到任何解决方案。

如何在 .h 文件中声明一个 NSString?

我试过这个:

@property (nonatomic, retain) NSString *DATABASE_NAME;

但我得到一个错误:

Expected member name or ';' after declaration

这里有什么问题?

编辑

我的头文件:

@interface GlobalVariables : NSObject

    @property BOOL MAP_SATELLITE_VIEW;
    @property (nonatomic, retain) NSString *DATABASE_NAME;

+ (GlobalVariables*)sharedInstance;

@end



Best Answer-推荐答案


您显示的代码没有任何问题,因此您必须查看其上下文。一些想法:

关于ios - 在 .h 文件中声明 NSString - objective-c ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49830067/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4