你好,游客 登录 注册 搜索
背景:
阅读新闻

Objective-C调用C++文件

[日期:2013-03-31] 来源:Linux社区  作者:viviwen [字体:大 中 小]

参考文章:http://www.linuxidc.com/Linux/2013-03/82019.htm,但是发现同样的方法在xcode 4.6已经不行了,实例化对象时会报:

“Receiver type for instance messages is a forward declaration”的错误。即使将"@class Hello;" 改为#import "Hello.h"也还是会在NewHello上报"Unkwon type class,did you mean Class" 的错误。

解决方法是:

The solution is to add

 #import "Hello.h" 

to your ViewController.m file and change the file type of ViewController.m to Obj-C++ (from the right panel)

折腾半天的问题到此终于解决。

linux
相关资讯       Objective-C 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款