How to view the image(cv::mat) in the debug mode in xcode

Recently, I am learning some knowledge about OpenCV on Mac, refer to the online tutorial to configure OpenCV of C++ on Xcode, and implement some simple examples on Xcode.

The biggest problem encountered is how to preview the image in debug mode. The cv::Mat image cannot be previewed directly, which is very unfriendly for debugging. I also found some solutions to this problem on the Internet, and these results are disappointing, at least for me as a programming beginner. I hope that this function implemented by xcode has the corresponding "OpenCV Image Viewer" plug-in on other IDEs on Mac such as Pycharm and CLion, and the "Image Watch" plug-in corresponding to Visual Studio on Windows.

For me, this feature is necessary. According to this idea, is it a wrong choice to learn OpenCV C++ with Xcode, and embracing CLion on a Mac is the best choice for me? (Considering that Xcode is an IDE for Swift, I don't know much about Swift.) The process of implementing these simple examples on Xcode is still very enjoyable. I like Xcode's UI design. Therefore, I still hope that there is the best way to solve this problem in Xcode.

The following is an example of running C++ OpenCV on Xcode:

Xcode Version: 13.2.1 (13C100)

OpenCV Version: stable 4.5.3 (bottled)