aircraft aircraft - 7 days ago 6
Objective-C Question

#import "Project-Swift.h" comes some strange issue

Project is mixed with

oc
and
swift
.

#import "myProjectName-Swift.h"
in the
AppDelegate.m
,:

Project is
Objective-c
language created by me, and using almost
swift
language to write. and In the
Appdelegate.m
I want to use
swift
's class, and so

But unfortunate, my project occurs some
error
in
myProjectName-Swift.h
:

the issues

The code is below:

SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy)
NSString * _Nonnull 请校对以下信息,由此产生后果本公司不负责;)

+ (NSString * _Nonnull)请校对以下信息,由此产生后果本公司不负责;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy)
NSString * _Nonnull 是否删除银行卡;)

+ (NSString * _Nonnull)是否删除银行卡;

SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) UIColor * _Nonnull APP_COLOR;)

+ (UIColor * _Nonnull)APP_COLOR;


The error are:

Expected ';' at end of declaration list.

cannot declare variable inside @interface or @protocal

Expected member name or ';' after declaration specifiers

Expected ']'

Property requires fields to be named

Missing '[' at start of message send expression


And so on...




Attension

And In the global
swift
, I set Chinese characters variable like this:

class Global: NSObject {

static let 手机号码不能为空 = "手机号码不能为空"
static let 请输入正确的手机号码 = "请输入正确的手机号码"
static let 请输入6位或以上的密码 = "请输入6位或以上的密码"
static let 验证码错误 = "验证码错误"
}





EDIT - 1

Because I think a error point out the
static let 请校对以下信息,由此产生后果本公司不负责 = "请校对以下信息,由此产生后果本公司不负责"
's
,so I annotation this line, project will not show this
error
. Or I delete the
,`, will not show the error too.

hnh hnh
Answer

Objective-C doesn't support Unicode in identifiers (variable names, class names, method names etc), only in string literals ("