我正在尝试将Java可空注释转换为Objective,以便在Swift中获得选项,但是没有发生任何事情,方法的签名保持不变。
以下是Java代码:
import javax.annotation.Nullable;
import com.google.j2objc.annotations.ObjectiveCName;
public class UserValidation {
@Nullable
@ObjectiveCName(value = "getFormattedUserId:")
public static String getFormattedUserId(@Nullable String userId) {}
}当我被毁的时候:
+ (NSString *)getFormattedUserId:(NSString *)userId;而不是:
+ (NSString * __nullable)getFormattedUserId:(NSString * __nullable)userId;我要这个签名罪斯威夫特:
class func getFormattedUserId(userId: String?) -> String?我做错什么了?
非常感谢。
发布于 2016-01-12 09:13:45
https://stackoverflow.com/questions/34724915
复制相似问题