View Single Post

Member Since: Jun 12, 2009
Posts: 1
KinAZ is on a distinguished road

KinAZ is offline
Hi All!

I'm a newbie to programming. Please look at my code below. Why isn't there a release like [exception release] for the NSException object created? How will the compiler know how to release the NSException object? I understand why/how f is released (from [f release] statement).


NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Fraction * f = [[Fraction alloc] init];

[f noSuchMethod];

@catch (NSException *exception){
NSLog (@"Caught %@%@", [exception name], [exception reason]);

NSLog (@"Execution continues!");
[f release];
[pool drains];
return 0;

QUOTE Thanks