I got three memory leaks I can't figure out. These leaks I found by using Instruments > Leaks.
Leak 1: This leak I have no idea what is or what causes it.
Code:
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil); // LEAK
[pool release];
return retVal;
}
Leak 2: Here I make some objects (NSMutableDictionary) and put them in the elements array. I release the array
elements in dealloc.
Code:
NSMutableArray *elements;
NSMutableDictionary *item;
...
[elements addObject:[item copy]]; // LEAK
[item release];
Leak 3: Here the first and third lines comes up as a leak. In the dealloc-function I release the parser and set's it delegate = nil.
Code:
parser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.rabaldus.no/apps/..."]]; // LEAK
[parser setDelegate:self];
[parser parse]; // LEAK
Maybe I need to submit more code, but hopes this is enough for a start to figure out the leaks.