Hello,
I noticed that ARC is disabled in the CMakeLists.txt for the Native Metal Sample Application (
https://github.com/Live2D/CubismNativeSamples/blob/develop/Samples/Metal/Demo/proj.ios.cmake/CMakeLists.txt):
# Disable ARC
set_target_properties(
${APP_NAME}
PROPERTIES
MACOSX_BUNDLE YES
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC NO
)
Is there a reason for using MRC over ARC? I'm developing a native iOS application and am considering moving the sample implementations to use ARC in order to play nicer with Swift/SwiftUI.
Thanks!
Comments
Thanks for using our product.
For historical reasons, the Metal Sample was created in Objective-C based on the OpenGL implementation, which is why ARC is disabled.
There is a possibility that ARC will be enabled when we migrate the Metal Sample to Swift in the future.
Also, with the current Sample, I believe you can enable ARC by modifying ViewController.mm.
Best regards.
> Could you go more in detail on how to enable ARC by modifying ViewController.mm?
ARC cannot be enabled because there are locations in this file where release is explicitly called. Therefore, I believe several modifications will be necessary. However, please note that I have not actually tested this.
Thank you.