Can not release 2D array with free in C

im trying to dealloc a Matrix i've created in MatrizCrea(n,m) using MatrizLibera(v), but both of the free() are telling me that there is a conflict of types. I've done this code following severa sources, so I'm quite unsure of why this error is happe

iOS - Using dealloc to remove the observer

I have a basic question regarding removing observer. I have a ViewController parent class which is inherited by 3 ViewController child classes. eg. BookVC -> BookHotelVC, BookFlightVC, BookTrainVC Here, I added an observer in the viewDidLoad of paren

Why is callloc called immediately after instantiation?

I have a small problem with ARC and dealloc of the BaseViewController class being called after the instantiation inside the loop and I don't know why. What I'm trying to do is basically store all the base view controllers on an array. @interface Cate

Crash on EXC_Breakpoint Scroll View

This is a new problem I have been having ever since I've been updating my app for iOS 7. Everytime I launch the app on my device or simulator, I get this error code RecipeDetailViewController scrollViewDidScroll:]: message sent to deallocated instanc

replacing the dealloc method in the target-c

Can someone tell me what would actually happen if you override the dealloc method in Objective-C? As in would it crash or would it just start leaking memory all over the place. I've been wondering what would happen and why it is necessary to prevent

Why set self.object to zero causes a crash

In the following scenario I get a crash if (self.videoEngine != nil) { [self.videoEngine.player.view removeFromSuperview]; [videoEngine release]; self.videoEngine = nil; } The videoEngine object is (nonatomic, retain), and it is synthesized using vid

memory problem when switching from cclayer to my objects

I've got a CCLayer where I want to add many buttons. I created the class MyButton with this init function: -(id) initWithLayer:(MyLayer *)theLayer andDictionary:(NSDictionary *)data { self = [super init]; if (self != nil) { self.layer = theLayer; sel

Is it necessary to release this object in dealloc?

I have a question. In my .h: NSString *string; @property(nonatomic, retain)NSString *string; In my .m: string=[NSString stringWithFormat:@"%@", otherStringWithValue]; Ok, "stringWithFormat" is an autorelease method. Need I release &quo

Call UIViewController and is never deallocated

I've the class OTNetwork that is subclass of UIViewController. When user pushes a button I use this code to call it: OTNetwork *net = [[OTNetwork alloc] initWithNibName:@"OTNetwork" bundle:nil]; [self presentModalViewController:net animated:YES]

Confusion on dealloc calls

I have a basic question here. I know that dealloc will be called when the object's reference count becomes zero,and dealloc releases all the resources hold by the object or frees memory, right? The object reference count becomes zero if we send relea

ViewController is never deallocated

In my mind, myViewController should be deallocated around the time that I pop back to the root view controller with the following code, but I never see the deallocation message getting NSLogged. If this should work, then what kind of problem can I lo

UIPopoverController dealloc is called the ARC environment

While displaying a popover controller for a second time (after dismissing it and then re-displaying it), I get the following error: Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while

My retainCount increases?

am trying here to build rss reader , the problem that when user finish read artical and press back the dealloc don't called and i got retainCount 6 & some times 7 !! i have lots of customized panels when back button pressed the view is poped and no d

Pile of corruption

I don't even know where to start... Visual Studio keeps giving me a heap corruption error when I close my program. The position it breaks at varies. During the 40+ hours I have spent changing my code (removing smart pointers, removing implementation

Dealloc method in iOS and setting objects to zero

I have a pretty basic question. In some examples I've seen, objects are just released in the dealloc method. In others, the objects are released and then set to nil. Is there a reason for this? Is setting to nil after releasing advantageous?Three way

Question of deallocation of objects

I have a code: @interface PhotoListViewController : UIViewController { IBOutlet UIImageView* firstPicContainer; IBOutlet UIImageView* secondPicContainer; UIImage* pic_one; UIImage* pic_two; IBOutlet UILabel* firstPicLabel; IBOutlet UILabel* secondPic

Conditional allocation / dealloc? [Objective-c and Cocos2D]

What if I want to alloc a class inside another and I want to reference it easily, but sometimes this class would not need to be alloc'd, therefore not dealloc'd. How is this done? Can I put a conditional inside dealloc so it doesn't have to be releas

Publishing the custom NSObject class in the iOS app

I have a Class which I have created as an NSObject. This class has a number of properties of different types and methods etc. When I instantiate this class in my App (say in the main View Controller) I immediately send it a release call when I am fin

UINavigationController and UIViewController dealloc

I recently changed my app to use a UINavigationController, I was using a UINavigationBar before, with cascade subView adding, which was a bit tenuous. I'm facing a problem of memory usage. Leaks tool doesn't show any leak, but ViewControllers I creat

Ambiguous scenario for iPhone memory management

I have some difficulties to understand this scenario. I create an object I set its retained property to something I forget to release its property I release the object As I didn't release the property in the dealloc method, will the scenario result i

What is your preferred coding style for dealloc in Objective-C?

I know that discussions about coding styles tend to end in disaster and endless flame wars, but that's not what I want to reach. During the last decade I mainly saw two different coding styles for dealloc methods in Objective-C. The first and most co

a difference between these two methods dealloc?

So i'm overriding dealloc method because the object is a composite object made up of one other object. I originally had this dealloc method: -(id) dealloc; // Override to release the Rectangle object's memory { [rect release]; [super dealloc]; return

Problem when looking for a memory leak

Hey everyone, i am having trouble finding a memory leak. all off my retain counts = 0 when i dealloc them but still I am flagging up a leak from the following bit of code: - (GKSession *) peerPickerController:(GKPeerPickerController *)picker sessionF

iPhone - Release of several UIViewControllers

My main UIViewController, (PMGameViewController.h), is the file which my apps delegate calls. There are several buttons on my main UIViewController (PMGameViewController.m). When a button is pressed I do an insertSuvbiew and attach another UIViewCont