小编Bas*_*lba的帖子

如何使用 ruby​​ 读取 .xcconfig 文件常量以将它们用作 Fastlane 通道变量?

我正在尝试使用当前配置使用 Fastlane 部署我的 iOS 应用程序:具有多个目标和多个环境的单个项目(使用 .xccconfig 文件)。我创建了 3 个通道:开发、测试、分发。这些车道采用“brand_name”作为参数,因此我可以为每个目标使用相同的车道。

我想要实现的是“读取”目标的 .xcconfig 文件(例如PRODUCT_BUNDLE_IDENTIFIER)中的常量并将其用作我车道中的变量。我设法通过创建和读取包含目标包 ID 的 yaml 文件来做到这一点,但由于我已经在使用 .xcconfig 文件,我想避免重复。我做了一些搜索以找到答案,但由于我对 ruby​​ 相当陌生,所以我现在陷入困境。有没有办法实现这一目标?

如果有帮助,这是我目前正在使用的工作通道,并在我想使用 .xcconfig 文件而不是 yaml 文件替换的部分上发表评论:

lane :development do |options|

    # Getting lane settings

    #adding lane_name to the options
    options = options.merge(lane_name: 'development') 

    # THIS IS THE PART I'D LIKE TO REPLACE WITH .XCCONFIG FILE INSTEAD OF YAML
    #fastlane config path
    config = YAML.load_file(File.join(File.dirname(__FILE__),"../Brand", options[:brand_name],"Configs/fastlane_config.yaml"))
    settings = OpenStruct.new(config)
    lane_settings = settings[options[:lane_name]]

    # Settings the App Identifier
    app_identifier = lane_settings["bundle_identifier"] …
Run Code Online (Sandbox Code Playgroud)

ruby xcconfig ios fastlane

5
推荐指数
2
解决办法
2118
查看次数

如何在自定义UITableView单元格上获取UITextField值

我是IOS开发的新手,我正在尝试开发我的第一个应用程序.

所以我的问题是......我有一个带有自定义单元格的UITableView,每个单元格都包含一个UITextField.当我按下一个按钮时,我想将每个UITextField值放在NSMutableArray中.

我想我必须做那样的事情,但我不确定:

NSMutableArray *playerNameArray = [[NSMutableArray alloc] init];

for (int i=0; i < nbPlayers; i++){ //nbPlayers is the number of rows in the UITableView
    NSString *playerName =UITextField.text;
    [playerNameArray addObject:[NSString stringWithFormat: @"%@", playerName]];
}
Run Code Online (Sandbox Code Playgroud)

如果有人可以帮助我.... :)谢谢

uitableview uitextfield nsmutablearray ios

2
推荐指数
2
解决办法
7921
查看次数