presentModalViewController Received Memory Warning !
Hello, There;
How is it going your life ? Please, yours answer : BOOL
BTW, if you have posted in this manner. Please, Follow the proposals.
We have a 2 viewcontroller.
MainViewController.h
#import "info.h"
@interface Hisse_SenediViewController : UIViewController <infoDelegate> {
info *mvc;
}
MainViewController.m
- (IBAction) info_clicked: (id) sender {
mvc = [[info alloc] initWithNibName:@"info" bundle:nil];
mvc.delegate = self;
if(![mvc retain]){
}
else {
mvc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:mvc animated:YES];
[mvc retain];
[mvc autorelease];
mvc = nil;
}
}
- (void) infoDidFinish: (info *) controller {
[self dismissModalViewControllerAnimated: YES];
}
info.h
@protocol infoDelegate;
@class info;
@interface info : UIViewController { IBOutlet UIButton *button_done; id<infoDelegate> delegate; } @property (nonatomic,retain) IBOutlet UIButton *button_done; @property (nonatomic, assign) id<infoDelegate> delegate; - (IBAction) button_action: (id) sender; @end @protocol infoDelegate - (void) infoDidFinish: (info *) controller; @end
info.m
@synthesize button_done,delegate;
- (void)viewDidLoad {
[super viewDidLoad];
[button_done release];
}
- (IBAction) button_action: (id) sender
{
NSLog(@"modalviewdismiss");
[self.delegate infoDidFinish:self];
[self release];
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.button_done = nil;
}
- (void)dealloc {
[super dealloc];
[button_done release];
}
It's finished.
Anyway , please remember. If you are not use the [release]. You get the same error. Please, don't forget.
GoodBye Cruel World.














