I have an Objective-C view controller class, from which I am trying to call a straight-C (not Objective-C) function. I want to pass in a string variable by reference, set its value inside the C function, and then back in my view controller I want to convert this to a normal NSString object.
Since I can't pass in an NSString object directly, I need to create and pass in either a char
pointer or a char
array, and then convert it to an NSString object after the function returns.
Can anyone point me to a simple code example that shows how to do this? I'm not strong in either Objective-C or regular C, so manipulating strings is extremely difficult for me.