可能重复:
比较 Cocoa 中的字符串
我需要对NSString*
变量执行逻辑。
如果我执行以下操作,它可以正常工作:
my_label_3.text = local_db_user.lifetime_subscription;
UI 中的标签会填充文本,True
但以下返回NO
:
local_db_user.lifetime_subscription == @"True"
我为这个伪代码使用什么代码:
if local_db_user.lifetime_subscription == True
do this
else
do this other thing
我的手表,在调试期间,local_db_user.lifetime_subscription
显示:
{NSString * | 0x764e210} "True"