0

I have a program structure like following :

int firstFunction(unsigned char *firstValue, int s, int t)
{
       CppFunction *cpp=CppFunction::create(firstValue, s, t, 0);

}

How would I take NSLog of cpp?

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
madLokesh
  • 1,860
  • 23
  • 49
  • Define some sort of "description" or "toString" function in the C++ class/struct that output a string so that it can be used by NSLog to print? I cannot think of other way. – nhahtdh Jun 25 '12 at 08:14
  • could you please elaborate... – madLokesh Jun 25 '12 at 08:15
  • Please check my edit. If my edit changes the meaning of your question in anyway, you can modify or revert my edit. – nhahtdh Jun 25 '12 at 08:18
  • thats ok... actually CppFunction::create is nothing but a class containg create function performing conversion of rgb to greyscale and i believe that cpp contains the greyscale data which i need to use to display in the UIImageView as UIImage... could you help me on that as well please – madLokesh Jun 25 '12 at 08:20
  • I don't know how to convert the data to UIImage. That aside, I think the conversion question qualifies for a separate question. – nhahtdh Jun 25 '12 at 08:22

1 Answers1

2

You can log certain values from CppFunction, check the example

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());
}
Omar Abdelhafith
  • 21,163
  • 5
  • 52
  • 56
  • the function create is converting image data to greyscale and i believe that cpp contains that value... so i need to log cpp so that i can see what i am getting.... also, how can i use cpp to display on the ImageView – madLokesh Jun 25 '12 at 08:17
  • You will need to convert the image to some sort of byte array and pass it to the cpp function, and then take it back and convert it again to NSdata and then UIImage – Omar Abdelhafith Jun 25 '12 at 08:19