• 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
[help!] a strange crash (to me)...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help!] a strange crash (to me)...


  • Subject: [help!] a strange crash (to me)...
  • From: Steve Christensen <email@hidden>
  • Date: Tue, 13 Jan 2004 11:07:14 -0800

I wrote an addition to NSString to return the full path to one of the special system directories, using FindFolder. I went this route instead of using NSSearchPathForDirectoriesInDomains since I have access to more directory choices. Anyway, my code is based off a snippet in listing 9-2 at http://developer.apple.com/documentation/Cocoa/Conceptual/ LowLevelFileMgmt/Tasks/LocatingDirectories.html:

+ (NSString*) findFolderInDomain:(short)domain type:(OSType)folderType create:(BOOL)create
{
NSString* path = nil;
FSRef folderRef;

if (FSFindFolder(domain, folderType, create, &folderRef) == noErr)
{
CFURLRef url = CFURLCreateFromFSRef(kCFAllocatorDefault, &folderRef);

if (url != nil)
{
path = (NSString*) CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);

CFRelease(url);
}
}

return path;
}

The problem I'm running into is that the call to CFURLCreateFromFSRef crashes in two cases: my client's computer running 10.2.x and on my 10.3.2 machine running the developer application ObjectAlloc. I've been running it on my machine, both in CW's debugger and standalone with no problems, so this came as a bit of a surprise.

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xff9cc000

Thread 0 Crashed:
0 0x00003a8c _start + 0x100
1 0x0000b4cc +[NSString(FindFolderExtensions) findFolderInDomain:type:create:] + 0x6c


Any clues as to what might be causing this and/or what else I might look at to try to narrow this down?

Thanks mucho...

steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: [help!] a strange crash (to me)...
      • From: p3consulting <email@hidden>
  • Prev by Date: Re: Controlling NSTextView's ruler accessory view
  • Next by Date: Re: Spell-checking service
  • Previous by thread: Re: HTTP POST
  • Next by thread: Re: [help!] a strange crash (to me)...
  • Index(es):
    • Date
    • Thread