我一直在建立一个iOS应用和我的ViewControllers之一已成为全像:移动功能,以单独的类
CGPoint randomPoint()
{
//Code goes here
}
我现在想将其移动到A级(或协议,我不知道什么会为我工作),在VC导入并调用像以前一样:
p=randomPoint(); //NOT A.randomPoint(), [A randomPoint] or whatever
我尝试使用C++类模板,但它与CGPoint,和的CGRect这么久的问题。
我该如何做到这一点?
为什么不制作静态内联指令?他们在任何头文件'.h'文件中都足够快乐。 – holex