After a lots of tries I finally succeeded in having obj-c code working with Edgelib:
I made a .mm file (it doesn't work with a .m file !)
- Code:
#import <UIKit/UIKit.h>
void MyExternalObjCFunc(int param)
{
// UIWindow *edgewindow = (UIWindow *)param; // doesn't work
UIWindow *edgewindow = [[UIApplication sharedApplication] keyWindow];
CGRect frame = {0, 100, 320, 140};
UITextField *text = [[UITextField alloc] initWithFrame: frame];
[text setBorderStyle:UITextBorderStyleRoundedRect];
[edgewindow addSubview: text];
[edgewindow bringSubviewToFront: text];
}
And then calling MyExternalObjCFunc(GetWindowHandle()); one time in NextFrame from the Edgelib class.
It's working but I get random crashes when using the text field. can somebody explain me what I'm doing wrong in this example ?
I think for the next release of edgelib you should include a little tutorial or code sample on how to do such thing on iPhone.
Also, when I'm using the simple helloworld example, it seems to run fine on the device but I always get a crash report each time I run the program on the device. (in the xcode / organizer window) This happen with the helloworld example unmodified and without obj-c stuff.
I compiled with SDK 2.2.1 Release, and testing on an iPod 3.1.3.
Also, I can't test on the simulator, because it seems that only the lib for the device are included in the 3.985 version of the sdk.