我 st着这种法典:
static NSMutableSet* test_set;
-(void)foo1
{
test_set=[NSMutableSet setWithObject:[NSNumber numberWithInt:1]];
NSLog(@"count:%d",[test_set count]);
}
-(void)foo2
{
NSLog(@"pointer:%p",test_set);
NSLog(@"count:%d",[test_set count]); // here I get EXC_BAD_ACCESS
}
I calling foo2 only after foo1. My debug out is like:
count:1
pointer:0x262790
Program received signal: “EXC_BAD_ACCESS”.
What s wrong? __ Intresting note: it fails only when foo2 is calling in schedule.__ Sorry, I missed details. Both works perfect. Thank you all