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.)

2 thoughts on “Mixing Objective C and C++… Heh

  1. 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++…

    Like

    • 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.

      Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s