Re: [help!] a strange crash (to me)...
Re: [help!] a strange crash (to me)...
- Subject: Re: [help!] a strange crash (to me)...
- From: p3consulting <email@hidden>
- Date: Wed, 14 Jan 2004 09:34:56 +0100
FYI
under 10.3.2 and using objectAlloc with your example code and calling:
NSString *aString = [NSString findFolderInDomain:kUserDomain
type:kTrashFolderType create:NO] ;
NSLog(@"%@",aString);
doesn't crash here.
What arguments (domain, folderType, create) are you passing when you
get the crash ?
Do you get the same crash for every set of arguments ?
Pascal Pochet
P3 Consulting
On 13 janv. 2004, at 20:07, Steve Christensen wrote:
>
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.
_______________________________________________
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.