by makecheck · 14y ago · 0 comments
As much as I'm a fan of RAII in C++, it really is a "pure C++" idiom. If a C++ class is needed in Objective-C code that can @throw an NSException, then the C++ cleanup code really has to be invocable explicitly (because the destructor might not be called). For example:
MyCPlusPlusObject object;
@try
{
...
}
@finally
{
object.cleanup();
}No comments yet.