• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to build c++ file and create its instance in another objective-c class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to build c++ file and create its instance in another objective-c class


  • Subject: Re: how to build c++ file and create its instance in another objective-c class
  • From: "Tang Ke" <email@hidden>
  • Date: Fri, 6 Jun 2008 16:04:49 +0100

Hi Jean,

Merci!

I tried to rename it to Adder.mm, also tried to rename my viewcontroller to
viewcontroller.mm, it didn't work. I searched google, ADC, and cocoadev.com,
and really couldn't find an answer.

Cheers,

Tang

2008/6/6 Jean-Daniel Dupas <email@hidden>:

>
> Le 6 juin 08 à 16:53, Tang Ke a écrit :
>
>  Hi,
>> I'm new to iphone os programming and my project involves to build c++
>> files
>> within the xcode cocoa touch environment.
>>
>> So i tried to create a new cocoa touch project and use the interface
>> builder
>> to add a button and a label.
>> So that when i press the button, the label would show the result of the
>> "add()" method i call from the following c++ file.
>>
>>
>> I then add a new c++ file called Adder.cpp which looks like this:
>>
>> class Adder{
>>
>> public:
>>
>> Adder();
>>
>> int add(int x,int y){
>>
>> return x+y;
>>
>> }
>>
>> };
>>
>>
>> Simple enough, following the example i found from
>>
>> http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_12_section_3.htm
>>
>
>
> The first thing to do it to learn how to search the mailine list archive.
> For example try to search for iPhone and NDA:
>
> http://www.cocoabuilder.com/search/archive/cocoa?words=iphone+nda
>
> Then try to compile your file as an obj-c++ file and not as a C++ file. To
> do this, rename it using the .mm extension (instead of .m or .cpp).
>
>
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: how to build c++ file and create its instance in another objective-c class
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >how to build c++ file and create its instance in another objective-c class (From: "Tang Ke" <email@hidden>)
 >Re: how to build c++ file and create its instance in another objective-c class (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Regular Expressions?
  • Next by Date: Re: NSWindow does not support utility styleMask 0x10 ???
  • Previous by thread: Re: how to build c++ file and create its instance in another objective-c class
  • Next by thread: Re: how to build c++ file and create its instance in another objective-c class
  • Index(es):
    • Date
    • Thread