gpt4 book ai didi

iphone - 访问类中的常量而不在 Objective C 中创建类的实例

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:30:26 26 4
gpt4 key购买 nike

<分区>

下面的 C# 类只是用来保持常量。所以我们可以使用类名访问每个所以 'Constants.DIR_ARCHIVE' 会给出 'Archive'。

如何在 ObjectiveC 中定义下面的 C# 类?

 public class Constants
{
//Resource Directory Names
public const string DIR_ARCHIVE = "Archive";
public const string DIR_DEPARTMENTS = "Departments";
public const string DIR_FORMS = "Forms";
public const string DIR_GOAL_TRACKING = "GoalTracking";
public const string DIR_ROLES = "Roles";
public const string DIR_HOMEWORK = "HomeWork";
public const string DIR_POSTINGS = "Postings";
public const string DIR_SIGNUP = "SignUp";
public const string DIR_SITE_CONFIG = "System";
public const string DIR_PORTFOLIO = "Portfolio";
public const string DIR_MEMBERDEFINITION = "Definitions";

//Integer Constants
public const int LOG_DEFAULT_DURATION = 1;

//Other Constants
public const string OP_STATUS_ERROR = "Error";
public const string OP_STATUS_SUCCESS = "Success";
public const string OP_STATUS_WARNING = "Warning";
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com