gpt4 book ai didi

iphone - 在 Objective C 中的实现上下文内部和外部声明静态变量的区别?

转载 作者:技术小花猫 更新时间:2023-10-29 10:09:19 30 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Where do I have to declare static variables?

我见过这样的代码

@implementation ClassA

static NSString *str = nil;

.....

@end

还有

static NSString *str = nil;

@implementation ClassA

.....

@end

如果在@implmentation 上下文中声明静态变量与在外部声明静态变量有什么区别

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