Re: Pascal String Woes ...
Re: Pascal String Woes ...
- Subject: Re: Pascal String Woes ...
- From: Robert Kuilman <email@hidden>
- Date: Wed, 11 Feb 2004 22:10:32 +0100
J,
I'm not quite sure, but i believe that you are (as the type suggests)
passing a pointer as an argument to a function that actually expects an
allocated object.
i suggest you try changing
StringPtr strAPtr;
into:
Str255 PStrA;
and
CFStringGetPascalString((CFStringRef) strA, strAPtr, 256,
kCFStringEncodingASCII);
into
CFStringGetPascalString((CFStringRef) strA, &PStrA, 256,
kCFStringEncodingASCII);
Hope that helps,
Robert K.
-----------------------------{ Official Cocoa Newbie!
}-----------------------------
web:
http://halfduplex.net/
email: email@hidden
On Feb 11, 2004, at 9:34 PM, J Nozzi wrote:
List:
Okay, I admit that my standard C knowledge is severely lacking here.
I've been *meaning* to read the $50 books I bought, really I have.
;-) In the mean time, the following code dies at the indicated line
(// DIES HERE) with a SIGSEGV / EXEC_BAD_ACCESS.
NSString * strA = [preferences objectForKey:@"contentsa"];
NSString * strB = [preferences objectForKey:@"contentsb"];
StringPtr strAPtr;
StringPtr strBPtr;
CFStringGetPascalString((CFStringRef) strA, strAPtr, 256,
kCFStringEncodingASCII); // DIES HERE
CFStringGetPascalString((CFStringRef) strB, strBPtr, 256,
kCFStringEncodingASCII);
... any takers?
- J
_______________________________________________
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.