• 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: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.


  • Subject: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • From: David Duncan <email@hidden>
  • Date: Mon, 18 Dec 2006 14:52:26 -0800

On Dec 18, 2006, at 2:28 PM, Matt Fox-Wilson wrote:

gCString sResult = L"";
UniChar* sSource = (UniChar*)(uint16*)sRef;

This may not actually be a problem, but it is relying on the internal layout of your class to function properly (I'm assuming sRef is another instance of a gCString?). Unless the UniChar buffer is inline at the start of this class and there are no virtual functions, this shouldn't work. All of that may even be true, but I wouldn't rely on it and it would probably be very useful to add a UniCharPtr() accessor to your class that just returns a UniChar* to your characters.


if (sRef.Length() < 1) return sResult;

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString * nsSrc = [NSString stringWithCharacters:sSource length:sRef.Length()];


NSString* nsExt = [nsSrc lastPathComponent];
sResult.CopyString((CFStringRef)nsExt);

return sResult;

-- David Duncan Apple DTS Quartz and Printing email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
      • From: John Stiles <email@hidden>
References: 
 >Cocoa called from Carbon, objc_msgSend crash in 10.3.9. (From: "Matt Fox-Wilson" <email@hidden>)

  • Prev by Date: idle processing on main thread suggestions?
  • Next by Date: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • Previous by thread: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • Next by thread: Re: Cocoa called from Carbon, objc_msgSend crash in 10.3.9.
  • Index(es):
    • Date
    • Thread