Mixing Objective C and C++… Heh

I just wrote:

return tasks[[value intValue]].objectID;

Heh heh heh heh heh…

(For those who don’t understand, I just called a std::vector array operator[] method for the array ‘tasks’ with the return value of an Objective-C invocation of ‘intValue’ on the NSNumber value.)

Filed under: C++, Objective C++ | Posted on June 9th, 2008 by William Woody

2 Responses to “Mixing Objective C and C++… Heh”

  1. Axel Says:

    Too bad that the new iphone SDK (4.0) won’t allow this anymore. Only Objective-C, C or C++ allowed. No Objective-C++ allowed. Verboten!

    Hope you don’t have too much code written in ObjC++…

  2. William Woody Says:

    I know. I’ve been watching the xmlvm mailing lists to see what they decide, since it’s the same underlying problem.

    Though I think I’m safer than Adobe Flash.

    One significant problem I was running into was performance. Because I was allocating an NSAutoreleasePool object on pretty much every method call to handle garbage collection, performance sucked big time. I may just toss the code up on the web site and park the project.

Leave a Reply

You must be logged in to post a comment.

Categories

Archive

Links

Meta

Copyright © 2010 William Edward Woody. All rights reserved.

Theme modified from the original Tech Blue, designed by Hive Designs • Ported by Free WordPress Themes and Linux Web Hosting