码迷,mamicode.com
首页 > 编程语言 > 详细

C++调用Object-C界面

时间:2014-06-10 09:55:00      阅读:512      评论:0      收藏:0      [点我收藏+]

标签:c   a   使用   os   c++   代码   

在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

C++调用Object-C界面

标签:c   a   使用   os   c++   代码   

原文地址:http://www.cnblogs.com/coolbear/p/3778309.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!