I have some sort of problem.
Im making a bitmap library, and all works pretty well at the moment.
however, i have one problem when i initialize the class with an invalid bitmap.
I have a method called initWithContentsOfBitmap: (NSString *)path;
This method does:
self = [super init];
After that, it goes on to allocate some composite objects, and then calls loadBitmapFromFile: (NSString *)path;, where path is supplied from initWithContentsOfBitmap.
What i want, is when the path is invalid, i want the object to destroy itself before returning nil. Once the path is invalid, i can get initWithContentsOfBitmap to destroy all the objects it created, but im not sure out to get it to destroy itself without giving it the autorelease command.
Any ideas?
Im making a bitmap library, and all works pretty well at the moment.
however, i have one problem when i initialize the class with an invalid bitmap.
I have a method called initWithContentsOfBitmap: (NSString *)path;
This method does:
self = [super init];
After that, it goes on to allocate some composite objects, and then calls loadBitmapFromFile: (NSString *)path;, where path is supplied from initWithContentsOfBitmap.
What i want, is when the path is invalid, i want the object to destroy itself before returning nil. Once the path is invalid, i can get initWithContentsOfBitmap to destroy all the objects it created, but im not sure out to get it to destroy itself without giving it the autorelease command.
Any ideas?