Save before switching to objective-c++