作者:倪好蛋蛋小猪 | 来源:互联网 | 2023-02-05 12:52
ImimplementingastaticC++libraryforsortingalgorithmusingXcode.Iwanttousethislib(fil
I'm implementing a static C++ library for sorting algorithm using Xcode. I want to use this lib (file .a) in my iPhone App. Of course I will have to write a wrapper for C++ and C (file .mm).However my problem is that I want to be notified from this lib after each fixed period.
我正在使用Xcode实现一个静态C ++库来排序算法。我想在我的iPhone App中使用这个lib(文件.a)。当然我必须为C ++和C(文件.mm)编写一个包装器。但是我的问题是我希望在每个固定的时间段之后从这个lib中得到通知。
For example, I'm implementing "Insertion" algorithm, and I want the process happens in 10s, and then after each second, the lib will return a new sorted array (of course it's incomplete) until the last complete sorted array. How can I do this? How to notify Objective C from static lib C++ like this ? If not using static lib, I suppose the problem is not difficult, but I want to re-use this lib in Java also.
例如,我正在实现“插入”算法,我希望该过程在10秒内完成,然后在每秒之后,lib将返回一个新的排序数组(当然它不完整),直到最后一个完整的排序数组。我怎样才能做到这一点?如何通过这样的静态lib C ++通知Objective C?如果不使用静态库,我认为问题并不困难,但我想在Java中重用这个库。
1 个解决方案