TAG

objc

  • December 7, 2020
  • July 29, 2021

Tips for combining Objective-C and Swift

The applications have been used long time can not be written with only Swift. They ofter contains C/C++ or Objective-C codes. My mac application is also written with C/C++ and Objective-C. This post says that tips for combining Objective-C and Swift. Declare the code supports ARC If your code expects that is compiled with ARC, you should declare it. The following code reports the error when you compile without the ARC. #if !__has_feature(objc_arc) #error This source file must be compiled with ARC. #endif If you write the warning “This source file must be compiled with ARC” with the comment only, […]