• 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 display Japanese in debug console?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to display Japanese in debug console?


  • Subject: Re: How to display Japanese in debug console?
  • From: Chris Hanson <email@hidden>
  • Date: Mon, 26 Jun 2006 01:52:03 -0700

On Jun 25, 2006, at 7:01 PM, Norio Ota wrote:

But Carbon doesn't have NSString class, how do you think I define NSString for using it in Carbon?
Do I need to set any flags of the build setting of the target in Xcode?


This is the first time for me to use Cocoa function in Carbon environment, so that I'm very sorry to bother you.

In order to make use of Cocoa functions within your code, you'll need to do a couple of things.


First and probably most obviously, you'll need to link against Cocoa.framework.

Next, you'll need to ensure your code is being compiled as Objective- C or Objective-C++ rather than C or C++. You can do this by either changing the file extension to .m for Objective-C or .mm to Objective- C++, or by changing the file type of the file in Xcode's inspector for the file to "sourcecode.c.objc" for Objective-C or "sourcecode.cpp.objcpp" for Objective-C++.

Finally, you'll need to #import the appropriate header file in your code to make the declaration visible to the compiler. You can always just #import the framework header (e.g. <Foundation/Foundation.h> or <Cocoa/Cocoa.h>) rather than an individual header.

One more thing: Because strings are so commonly used, Objective-C has a shorthand for creating a constant instance of NSString: Just use an @ in front of a constant C string, for example:

  NSLog(@"Hello");

The effect of this is similar to the CFSTR() macro.

  -- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to display Japanese in debug console?
      • From: Norio Ota <email@hidden>
References: 
 >How to display Japanese in debug console? (From: Norio Ota <email@hidden>)
 >Re: How to display Japanese in debug console? (From: Damien Bobillot <email@hidden>)
 >Re: How to display Japanese in debug console? (From: Damien Bobillot <email@hidden>)
 >Re: How to display Japanese in debug console? (From: Norio Ota <email@hidden>)
 >Re: How to display Japanese in debug console? (From: Steve Sisak <email@hidden>)
 >Re: How to display Japanese in debug console? (From: Norio Ota <email@hidden>)

  • Prev by Date: Re: How to display Japanese in debug console?
  • Next by Date: Re: XCode 2.3 internal error upon opening project
  • Previous by thread: Re: How to display Japanese in debug console?
  • Next by thread: Re: How to display Japanese in debug console?
  • Index(es):
    • Date
    • Thread