Unity3D iOS RootViewController 가져오기

Cannot initialize a parameter of type 'UIViewController *' with an lvalue of type 'iOSFacebookPlugin *'

 유니티3D iOS 페이스북 연동 중 위와 같이 에러가 발생했습니다.

 RootViewController이 필요한데 유니티 iOS 프로젝트를 빌드하면 자동으로 생성되는 파일중 iPhone_View.h 와 mm에 위 그림과 같이 구현이 되어있습니다.


extern UIViewController* UnityGetGLViewController();


UIViewController* pRootViewController = UnityGetGLViewController();

 사용하는 부분에서 위와 같이 가져오면 됩니다. 일반적인 iOS 개발이나 cocos2d-x 기반에서 RootViewController을 가져오는 것보다 쉽네요.

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.