Re: NSString Retain Count of 2147483647
Re: NSString Retain Count of 2147483647
- Subject: Re: NSString Retain Count of 2147483647
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 24 Jun 2009 18:56:37 +0200
Le 24 juin 09 à 18:05, Bill Bumgarner a écrit : On Jun 24, 2009, at 11:03 AM, Jean-Daniel Dupas wrote: And it should not be an issue as you should not use it after release (the Static Analyzer will warn you if you do something like that).
I'm not sure the static analyzer will catch/warn about:
id someObject = [[MyObject alloc] init]; [someArray addObject:someObject]; [someObject release]; [someObject doSomething; As it might assume that someArray took ownership. If it doesn't, it should.
Actually it does not warn. But IMHO it should. What if 'someArray' is a subclass of NSArray that does not retain its content (a CFArray created using NULL callback for example) ?
And even with a standard NSMutableArray, it does not warn if you do something like this but should too:
id someObject = [[MyObject alloc] init]; [someArray addObject:someObject]; [someArray removeObject:someObject]; [someObject release]; [someObject doSomething];
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden