Iphone 将NSLog与C++;Objective-C+中的对象+;
我的程序结构如下:Iphone 将NSLog与C++;Objective-C+中的对象+;,iphone,ios,objective-c++,nslog,Iphone,Ios,Objective C++,Nslog,我的程序结构如下: int firstFunction(unsigned char *firstValue, int s, int t) { CppFunction *cpp=CppFunction::create(firstValue, s, t, 0); } 如何获取cpp的NSLog?您可以从cpp函数记录某些值,请查看示例 int firstFunction(unsigned char *firstValue ,int s,int t) { CppFunctio
int firstFunction(unsigned char *firstValue, int s, int t)
{
CppFunction *cpp=CppFunction::create(firstValue, s, t, 0);
}
如何获取
cpp
的NSLog?您可以从cpp函数
记录某些值,请查看示例
int firstFunction(unsigned char *firstValue ,int s,int t)
{
CppFunction *cpp=CppFunction::create(firstValue, s, t,0);
NSLog(@"Log some integers %d", cpp->SomeInteger);
//charArray[100] for example
NSLog(@"Log some char array %s", cpp->charArray);
//or for example log a string description function
//myDescription will return a custom char array description of your class
NSLog(@"Log some char array %s", cpp->myDescription());
}
在C++类/Struts-中定义某种“描述”或“toString”函数,输出一个字符串,以便可以由NSLO打印使用?我想不出别的办法。请你详细说明一下……请检查我的编辑。如果我的编辑改变了你问题的含义,你可以修改或恢复我的编辑。没关系。。。实际上,CppFunction::create只是一个包含create函数的类,它执行rgb到灰度的转换,我相信cpp包含灰度数据,我需要使用这些数据在UIImageView中显示为UIImage。。。我不知道如何把数据转换成UIImage。除此之外,我认为转换问题适合单独的问题。函数create将图像数据转换为灰度,我相信cpp包含该值。。。所以我需要记录cpp,这样我就可以看到我得到了什么。。。。另外,如何使用cpp在ImageView上显示您需要将图像转换为某种字节数组并将其传递给cpp函数,然后将其取回并再次转换为NSdata和UIImage