Heya folks!
I've got another question.
I've got this NavigationController, which has a delegate: MainViewController.
In this navigation controller, there's a table view, which has the same delegate: MainViewController.
Whenever I press a row in the table, a view pops up called: itemViewController.
Now, this all works really great. But ...
So my code goes like this:
ArticleControllerController *ac = [[ArticleControllerController alloc] init];
ac.categoryIndex = idx;
NSLog(@"acc retain: %d", [ac retainCount]);
[app.nav pushViewController:ac animated:NO];
NSLog(@"acc retain: %d", [ac retainCount]);
[ac release];
NSLog(@"acc retain: %d", [ac retainCount]); ...
How is it possible that I have a dealloc without having an object allocated?
Please see the log when switching from the MAIN view to the RSSItem view.
The 0xdd5adf0 memory gets deallocated, but I can't find where it was allocated.
Thanks for any input.
ps: self (null) is from trying to print one of the properties of the 0xdd5adf0 obje...
I am writing a framework and I have an object with a custom init method:
@implementation OSDatabase
@synthesize database;
// MEM
- (void)dealloc {
sqlite3_close(database);
[super dealloc];
}
// INIT
- (id)initWithDatabasePath:(NSString *)path error:(NSError **)error {
if (self = [super init]) {
if (!sqlite3_open_v2([path UT...
Hi All! Assist me please, is this code correct? I mean, do we really need a dealloc method in this class, and why do or don't we? Will be a memory leak if we don't use dealloc here?
Thanx!
#import <Foundation/Foundation.h>
@interface MyData : NSObject
{
@private
NSString *name;
NSString *surname;
NSString *email;
...
According to NSObject's documentation:
Important: Note that when an
application terminates, objects may
not be sent a dealloc message since
the process's memory is automatically
cleared on exit --- it is more
efficient simply to allow the
operating system to clean up resources
than to invoke all the memory
management ...
The following process leads to a crash of my app:
the user opens a view and a request is send to the server
the request is executed in background
the user navigates back to the root view
the request has been finished
and the following code is executed
// MyDatasource.m
// e.g. in connectionDidFinishLoading
[callback loaded...