[help!] a strange crash (to me)...
[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.