objective-c++

Why does GCC handle iterators differently in release build?

The following code snippet compiles perfectly in debug mode, but fails with using optimisation. What is wrong with the second conditional expression? #include <vector> using namespace std; int main (int argc, const char * argv[]) { typedef vector<int> IntVector; IntVector intVector; IntVector::const_iterator iter; if (iter !=...

Using Objective-C++ static library in straight Objective-C target

I build a static library that uses Objective-C++. When it is used in a straight Objective-C target, I get Undefined symbols: "___gxx_personality_v0", referenced from: I can solve this by adding -lstdc++ to the target's "Other Linker Flags". Question: Is there a way to specify this in the static library itself to make this step unne...

Duplicate interface declaration for class 'Foo'

I was working on my program, and it seems something in the settings changed. Suddenly I have the error "Duplicate interface declaration for class 'Foo'". It mentions a header file being duplicated but there's only one copy. Interestingly this is only happening in debug mode, not device mode. Does anyone have any idea what might be wron...

UDP socket starting to fail to receive

I have a very annoying bug showing up. We have left our iPhone app running overnight. Every 2 seconds it sends a broadcast ping out on to the network via the open socket to inform that the device is alive. Now the other application detects that ping and attempts to send messages back. The problem is that despite the ping continuing...

Cocoa: Obtaining an image that's displayed in another application

One Google Chrome extension displays a window with an image once in a while, how can I get the image from it with Cocoa? Basically there is a window and image inside it, and I need that image for my program. Thanks for reading! ...

objective-c++ how to add method into c++ class

Hi all! i'd like to have a function in api style. But implementation must be on Objective-C lang. So i've read some information and decided to do following - to mix objective-C with C++. And have problem to call an objC method in C++ class. Thats my example: //MYClass.h : class CClass { private: id fileName; BOOL rez; public: bool ...