Important: Please read the Qt Code of Conduct -

[SOLVED] Include an iOS framework in QT header file

  • Hello ,I use qt5.3 on mac and i want to develop an application for iphone. I know how can i use objective c code in qt5.3. Now i want to use iOS UIViewController in qt header file.
    I have a bridge method in mainwindow.h to invoke a objective c++ method.
    //in mainwindow.h

    #include <UIKit/UIKit.h> //error come from here

    int bridgeMethodToCallObjectiveC(UIViewController *);


    I've put implementation of that method in .mm file.
    When i add #include <UIKit/UIKit.h> in header file to use UIViewController, i get this error:
    unknown type name 'nsstring' did you mean 'qstring'

    I've added LIBS += -framework UIKit in .pro file.
    how can i solve it?
    thanks in advance...

  • I solved it by myself.
    in mainwindow.h i changed the method signature and removed #include <UIKit/UIKit.h>
    public: int bridgeMethodToCallObjectiveC(void *);

Log in to reply