MyTestClass.hという名前のクラスがあるとします。
異なる方法で初期化される 3 つの NSString 変数があります。
クラス構造は次のようになります
@interface MyTestClass : NSObject {
NSString *testString1;
NSString *testString2;
NSString *testString3;
}
@property (nonatomic, retain) NSString *testString1;
@property (nonatomic, retain) NSString *testString2;
@property (nonatomic, retain) NSString *testString3;
@end
MyTestClass.m
@implementation MyTestClass
@synthesize testString1, testString2, testString3;
-(id) init{
self.testString1 = @"";
[self setTestString2:@""];
testString3 = @"";
}
今、私はMyTestClassのオブジェクトを作成することを計画しています
MyTestClass *obj = [[MyTestClass alloc] init];
このコード行の実行後、 testString1、testString2、およびtestString3の保持 カウントは1になると思います。
私は私の友人を正しいですか?
testString3 を解放するとどうなるか知っていますか?
これに関するヘルプをいただければ幸いです。
ありがとう