I get an "EXC_BAD_ACCESS" when I try to read a NSString...
- by micropsari
Hello !
This is a (very) simplified version of my iPhone code :
@interface x {
NSString * name1;
NSString * name2;
}
-init {
name1 = @"";
name2 = @"";
}
-(void) a {
name1 = @"uhuh";
name2 = [foo bar]; // return a (NSString *)
}
-(void) b {
NSLog(@"%@", name1); // it works
NSLog(@"%@", name2); // there I get an EXC_BAD_ACCESS...
}
Why I have this problem ? And how can I solve it ?
Thanks !