【发布时间】:2014-07-31 11:43:58
【问题描述】:
我有,
public class Contact: NSObject {
var sName : String?
var sUserEmail : String?
var sUserCellNo : String?
}
以及 ProductName-Swift.h 中的相应代码,
SWIFT_CLASS("_NAME_")
@interface Contact : NSObject
@property (nonatomic, copy) NSString * sName;
@property (nonatomic, copy) NSString * sUserEmail;
@property (nonatomic, copy) NSString * sUserCellNo;
- (instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
所以我可以在我的其他目标 C 中访问所有这些属性。
现在我必须在我的 Contact 类中添加新属性,这样它就变成了,
public class Contact: NSObject {
var iUserAddressID : Int? //newly added
var sName : String?
var sUserEmail : String?
var sUserCellNo : String?
}
但在清理构建后,我得到的 ProductName-Swift.h 与以前相同,
SWIFT_CLASS("_NAME_")
@interface Contact : NSObject
@property (nonatomic, copy) NSString * sName;
@property (nonatomic, copy) NSString * sUserEmail;
@property (nonatomic, copy) NSString * sUserCellNo;
- (instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
所以,我不能使用新添加的 iUserAddressID。如何解决这个问题?
仅供参考:使用 xcode6 beta4
【问题讨论】:
标签: ios objective-c swift ios8 xcode6