madLokesh
madLokesh

Reputation: 1878

Using NSLog with C++ objects in Objective-C++

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?

Upvotes: 0

Views: 3118

Answers (1)

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

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());
}

Upvotes: 2

Related Questions