objective-c++

How do I resolve link errors that appear in Objective-C++ but not Objective-C?

Hi guys, I'm converting my App Delegate file from .m to .mm (Objective-C to Objective-C++) so that I can access a third-party library written in Objective-C++. In Objective-C, my app delegate builds and runs fine. But when I change the extension, the project builds and I get link errors, all of which are missing symbols from a static li...

Initialising an object as its subclass in objective-c++ / iphone sdk

i have a class, in which i am initialising another class that i have made. the other class that i have made has a subclass with only a few changes (none to the init method). What i am wondering is will it be ok if i try to do this. the code looks something like this. in one of the cases: self.shapeLayer = [[UMShapeLayer alloc] init]...

Random code affects unrelated code

Hi I hope someone has an idea about this as I've driven myself crazy for two days trying to find it. I'm making an iphone game in objective c with cocos2d and box2d, paddles, balls, bricks nothing too fancy, the paddle handling code worked perfectly both x and y movement I made an addition of radial gravity code in another function but...

WebView not showing in NSWindow

I am developing a C++ app and I need to display a NSWindow with a WebKit WebView inside it. I've coded up the Objective-C class which will manage creating and displaying the window but the WebView contained inside it does not display. Here is my code. Any idea on what is wrong and how I can fix it? I'm compiling the below code with $g++...

Private Methods in ObjC++

Hi, I need to rename a ObjC Class Implementation File into *.mm, because I'm using a C++ Framework (Box2D). After renaming the file and setting the Filetype to "sourcecode.cpp.objcpp" my following declaration of private methods produces some errors like: error: expected identifier before 'private' The declaration of methods: @...

Are C++ initializers called in Objective-C synthesized properties?

Are C++ initializers called in Objective-C synthesized properties? Meaning if I write a custom initializer for creation from another object of the same type (C++) does the synthesized property setter call that initializer? ...

Copy Constructor not called by synthesized property setter in Objective C++ code

We all know how sparsely documented Objective-C++ is. I can't find anything on this, but I'm also finding it hard to find suitable unambiguous search terms. So, Stackoverflow to the rescue (I hope)! I have a C++ class that I have an instance of within an Objective-C(++) class (and I have the project setting enabled for constructors/ des...

Objective C syntax inside .cpp file?

I'm trying to copy over some example code into my own project. The example project is iPhoneExtAudioFileConvertTest from the sdk. The example project contains a file called ExtAudioFileConvert.cpp. This file contains what looks like Objective-C code: assert([NSThread isMainThread]); The example project runs fine, but the compiler comp...

iphone: threads + release pool + [ object release] = "message sent to deallocated instance"

Hi guys, i'm having a bad time with some little code running on the iphone basically, i just press a button, it calls runTest, it runs test method on a background thread. That's why I created an autorelease pool. if i run the below code i got a beautiful message on the console saying: 2010-09-07 11:45:15.527 test[1312:207] *** -[CFS...

objective-c memory management

Hi guys, i have some questions about objective-c's memory management, let's say: NSString * test= [[NSString alloc] init ] test=@"msg"; [object setStr1: test ]; // declared as: @property(copy, readwrite) [object setStr2: test ]; // declared as: @property(retain, readwrite) [object setStr3: test ]; // declared as: @property(assign,...

Coding Style: lock/unlock internal or external?

Hello, Another possibly inane style question: How should concurrency be locked? Should the executor or caller be responsible for locking the thread? e.g. in no particular language... Caller::callAnotherThread() { _executor.method(); } Executor::method() { _lock(); doSomething(); _unlock(); } OR Caller::callAnothe...

Problems with getting glyph outline with appendBezierPathWithGlyphs

I'm working with Objective-C++. I'm trying to get the path outline of a text using NSBezierPaths appendBezierPathWithGlyphs. The problem is: the output is rather nonsense :( What I've written: String str = Ascii8("test string"); int length = str.getLength(); NSFont* font = [NSFont fontWithDescriptor: [NSFontDescriptor fontDesc...

Objective-C++ and .cpp files in Xcode

Hello, I'm trying to make a simple Objective-C++ applicaiton. All of my code is compiling fine, including the use of C++ in Objective-C classes, until I try and add a C++ class to the mix. I've created a simple C++ class: Test.h class Test { }; and included this file in a Objective-C class (with a .mm extension) and I get the fol...

apple's developer license

Hi Guys, We are company with 10 iOS developers. Do we need to purchase developer license for each machine? Or is there any concept of purchasing bulk licenses? Like what is the alternative of single user license? Regards ...

gcc -x objective-c with Android SDK

Since Objective-C exists and is supported even in MinGW, by passing -x objective-c, is there a hack to achieve this with Android SDK? I've did a rudimentary test on a colleague's machine where it appears that language objective-cis not supported. I am not interested in getting UIKit or AppKit, or even Foundation, to work; I've written m...

iostream and sstream for Objective-C

I'm trying to port some C++ code to Objective-C. It includes iostream and sstream, but Objective-C does not recognize these. What should be done? ...

a problem about using const char* to pass parameter

I first store the 3 value into a pair of map like this: void AddMenuAtlasTexture( int tag, const char* filename, const char* textureName ) { map<const char*, const char*> _item; _item.insert(pair<const char*, const char*>(filename, textureName)); m_texturesToLoad.insert(pair<int, map<const char*, const char*> >(tag, _item)); }; th...

How to wrap a C++ lib in objective-C ?

I have a C++ library (.h only) that contains the implementation of a data structure and I'd like to use it in my iPhone app. Firstly, I wrote a wrapper in objective-C++ as a class that, through composition, has an ivar of the C++ class. I then was 'obliged' to change the wrapper class extension to .mm, and it seemed fine. But then I ha...

What is the difference between c++, objective-c and objective-c++?

Hi Guys, I want to know the difference between c++ and objective-c and objective-c++. Can any one give me the difference and Can we use the c++ for iPhone development Thank you, Madan Mohan ...

C++ and Objective-C autorelease problem

Hi, I have three layers, the bottom layer is written in C++ and the other two middle and top layers are both in Objective-C. The C++ layer stores a reference to a class in the middle layer, and the middle layer also stores a reference to a class in the top layer. Upon receiving a request from the middle layer, the bottom layer is resp...