all:
I've the following unit tests class (implementation file shown):
@implementation SampleTests {
A* c;
NSString* token;
}
- (void)setUp
{
[super setUp];
// Set-up code here.
c = [[A alloc] init];
}
- (void)tearDown
{
// Tear-down code here.
[super tearDown];
}
- (void)testA
{
token = @"sample";
}
-(void)testB
{
[c method:token]; // <-- fails because token is nil, but c has a correct value. Why!
}
@end
When I run my tests, testB fails because token is nil, but c it's ok, so why is it token
destroyed?