Re: Get MD5 without crashing
Re: Get MD5 without crashing
- Subject: Re: Get MD5 without crashing
- From: "Mr. Gecko" <email@hidden>
- Date: Tue, 4 Nov 2008 11:21:27 -0600
I finally got it working.
I put the crypto object in the header file and than every time the md5
method starts, it would release and make it nil
Thanks for the help,
Mr. Gecko
On Nov 4, 2008, at 11:16 AM, Andy Lee wrote:
On Nov 4, 2008, at 11:41 AM, Mr. Gecko wrote:
now that I added a auto release pool it crashes later on. but it
doesn't have to do with MD5 anymore it has to do with the hexdump
of SSCrypto.
[...]
- (NSString *)md5:(NSString *)MD5 {
SSCrypto *crypto = [[SSCrypto alloc] init];
[crypto setClearTextWithString:MD5];
return [[[crypto autorelease] digest:@"MD5"] hexval];
}
Is it possible either you need to retain the return value from this
method, or you're over-releasing it? Have you tried turning
NSZombieEnabled on?
You mentioned not being familiar with release and autorelease.
(Actually you said you couldn't find details on when to use them,
which I find surprising.) Have you read the document Jonathan del
Strother recommended?
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
Do not try to guess your way around retain and release -- you'll
just be wasting a lot of your own time. It's not that hard once you
get the hang of it.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden