Bradley Thomas
Bradley Thomas

Reputation: 4097

Method possibly missing a [super dealloc] call

I have a library that is building and throwing this warning because ARC is turned off. However the project itself is ARC enabled. What are the implications of ignoring this warning?

- (void)dealloc {
   if (_framesetter) CFRelease(_framesetter);
   if (_highlightFramesetter) CFRelease(_highlightFramesetter);
}

Upvotes: 0

Views: 4561

Answers (2)

neilco
neilco

Reputation: 8012

In the library with ARC turned off, you can enable ARC for individual files by adding the -fobjc-arc compiler flag in the Compile Sources build phase. This will clear the warning.

Upvotes: 6

yurish
yurish

Reputation: 1535

If the dealloc is in the library and the library has ARC turned off the dealloc must have [super dealloc] at the last line of the method body. Otherwise superclass will not be able to release its resources and free the object memory.

Upvotes: 9

Related Questions