retainCount
retainCount
- Subject: retainCount
- From: Markus Hitter <email@hidden>
- Date: Sat, 14 Jul 2001 01:09:29 +0200
Hello,
here's a code fragment ripped out of a small app which gives me a signal
10 (SIGBUS):
@implementation Worker
[...]
NSString *intImageName;
[...]
- (void)awakeFromNib {
intImageName = [[NSString alloc] initWithString:@"temp-image-"];
intImageName = [intImageName stringByAppendingString:NSUserName()];
NSLog(@"intImageName's retain count is: %d", [intImageName
retainCount]);
[...]
The last line gives the signal. Using %@ instead of %d makes no change.
Removing the NSLog line makes the code work fine.
Anybody knows what's the trouble with retainCount?
As you can guess, I try to verify my knowledge about retaining and
releasing. Is there some other chance to view retains / releases /
memory leaks?
Thanks,
Markus
P.S.: Yes, I've read several Docs about the topic of memory
allocation. ;-)
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/