C++调用Object-C界面

时间:2014-06-10 09:55:00   收藏:0   阅读:512

在C++代码中想调用显示一个IOS界面,使用NSNotificationCenter

1、在界面中注册消息

[[NSNotificationCenter defaultCenter]  addObserver:self selector:@selector(mytestFunc:) name:@" mytest" object:nil];

//处理消息的函数

- (void) mytestFunc:(NSNotification*) notification

{

   id obj = [notification object];//获取到传递的对象

2、c++程序中发送消息

[[NSNotificationCenter defaultCenter] postNotificationName:@"mytest" object:searchFriendArray];

C++调用Object-C界面,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!