0

When I try to build my project, I get the following error message

ABC Functions forbid explocit messages send of dealoc

- (void)dealloc {
    [super dealloc];
}

this is the class def:

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>


@interface cPlay : UIViewController{
    MPMoviePlayerController *mp;

}
- (void) moviePlayBackDidFinish:(NSNotification*)notification;
-(void) NewVideo : (NSString *) strName;
@end
Vladimir
  • 170,431
  • 36
  • 387
  • 313
Ted pottel
  • 6,869
  • 21
  • 75
  • 134
  • Take a look at the following question. http://stackoverflow.com/questions/6273341/under-automatic-reference-counting-why-are-retain-release-and-dealloc-not-all – tjg184 May 22 '12 at 19:16

2 Answers2

0

When using ARC you generally don't need to write dealloc method for memory management as compiler will insert all necessary code for you, and if you really need to do not call [super dealloc] inside

Vladimir
  • 170,431
  • 36
  • 387
  • 313
0

Just remove the dealloc function, ARC (Automatic Reference Counting) doesn't allow dealloc by yourself. ARC will do that for you.

See this link:

http://www.raywenderlich.com/5677/beginning-arc-in-ios-5-part-1

One of the things I love about ARC is that in most cases it completely does away with the > need to write dealloc methods. When an object is deallocated its instance variables and
synthesized properties are automatically released. You no longer have to write:

- (void)dealloc
{
    [_window release];
    [_viewController release];
   [super dealloc];
}

because Objective-C automatically takes care of this now. In fact, it’s not even possible > to write the above anymore. Under ARC you are not allowed to call release, nor [super
dealloc]. You can still implement dealloc — and you’ll see an example of this later — but it’s no longer necessary to release your ivars by hand.

Lars
  • 512
  • 1
  • 3
  • 13