gpt4 book ai didi

objective-c - Objective-C 中的全局字符串变量

转载 作者:行者123 更新时间:2023-11-29 13:43:42 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How to use global variables in Objective-C?

在我的 Login.m 文件中,我有

NSString *userName = txtUsername.text; // this is getting the text from the username text field and storing it in userName

问题是我还需要从不同的类访问变量 userName,因此我需要将其声明为全局变量。执行此操作的最佳方法是什么?

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