问题标签 [objective-c++]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
150 浏览

objective-c - 尺寸已定义

我今天弄乱了我的 Objective-C++ 命名空间。

我发现在 ObjC++ 中已经定义了 Handle、Size 和 Duration。它们的定义是什么,它们在哪里定义?

我只有#imported Foundation/Foundation.h

0 投票
2 回答
2239 浏览

iphone - 比较两个 Xcode 构建设置

我有一个项目,我主要使用两个构建设置。不幸的是,今天出了点问题。一个编译,另一个不编译。如何比较 XCode 中的两个构建设置以查看差异是什么?

(对于那些感兴趣的人,我在一次构建中遇到的错误是

如果您知道这意味着什么,我将不胜感激)

0 投票
2 回答
929 浏览

objective-c - XCode GCC-4.0 与 4.2

我刚刚将编译器选项从 4.0 更改为 4.2。

现在我得到一个错误:

它在 4.0 中运行良好

有任何想法吗?

0 投票
1 回答
186 浏览

c++ - Objective-C++ 可见性问题

我已经将一个库与我的程序相关联。它工作正常。唯一的问题是存在可见性错误/警告(数以千计)。

它们都是以下形式:

它始终与 AppDelegate.o 一起使用。我尝试通过多种方式设置库和主应用程序的可见性:XCode 中的可见性复选标记和 -fvisibility。似乎没有工作。AppDelegate.mm 有什么特别之处吗?

0 投票
1 回答
1736 浏览

c++ - Qt 中的 Mac OS X 链接器错误;CoreGraphics & CGWindowListCreate

这是我的 .mm 文件

链接器告诉我“_CGWindowListCreate”未定义。我必须链接到哪些库?Apple 的文档对于告知要包含或链接的内容不是很有帮助,就像 MSDN 一样。我也不能这样做#import <CGWindow.h>,我必须指定它的绝对路径......有什么办法吗?

0 投票
1 回答
2012 浏览

c++ - Objective-C++ 预编译头文件

我正在使用 C++ 库(它恰好位于 iPad 应用程序中,但我不确定这是否会产生任何影响)并且真的希望预编译头文件以加快构建速度,但 xCode 似乎通过 C 编译器而不是 C++ 编译器运行预编译的头文件。

有没有办法让它使用正确的编译器?我已经将所有源文件从 .m 更改为 .mm。

0 投票
2 回答
591 浏览

c++ - 包含来自 C++ 源文件的 Obj-C++ 头文件

考虑以下情况:

MacFont.h

MacFont 将在 MacFont.mm 中实现

字体引擎.cpp:

为了使它编译,我应该将 FontEngine.cpp 重命名为 FontEngine.mm 但我不允许这样做。

所以现在怎么办?

0 投票
1 回答
902 浏览

objective-c++ - 类 NSCFData 自动释放,没有适当的池

我已将我的 NSString 转换为字符串,并返回相同但标题中提到的上述错误正在控制台上打印。请提出建议,以便我可以摆脱这个问题。

我的代码如下:

字符串 stringFromNSString(NSString *inNSString)

{

}

0 投票
6 回答
1842 浏览

c++ - Objective-C++ 是与 Objective-C 完全不同的语言吗?

正如标题所说......他们被认为是不同的语言吗?例如,如果您使用 C++ 和 Objective-C++ 的组合编写了一个应用程序,您会认为它是用 C++ 和 Objective-C、C++ 和 Objective-C++ 编写的,还是同时使用这三种语言编写的?

显然 C 和 C++ 是不同的语言,即使 C++ 和 C 直接兼容,Objective-C++ 和 Objective-C 的情况如何?

0 投票
1 回答
891 浏览

scope - GCD / block scoping in Objective-C++

I'm using GCD to speed up some calculations in a few C++ templates I'm working on. I've already done it successfully for several functions, but now I'm trying to get it to work for a member function and I've encountered this weird scoping problem. The code looks something like this:

I understand that there might be some scoping issues when I'm accessing array elements like a._c1m[imodes2+jmodes+k], for instance (i.e. I might need to throw some pointers in there or something), but here's the real problem: when I declare NSIntegers like mi or just the looping indices j and k, for instance, the compiler gives me a ton of errors like the following:

'NSInteger op::mi' is not a static member of 'class op'

This has only happened to me for this member function--I implemented almost exactly the same technique on a friend function (with the same NSInteger declarations in the scope of the block) and it worked just fine.

The only fix I've been able to think up is declaring all of my looping variables outside the block as pointers and then dereferencing them in the scope of the block, but this strikes me as kind of a hack. Anybody know what's going on here?

Thanks in advance for your help!