About NSString - uppercaseString
About NSString - uppercaseString
- Subject: About NSString - uppercaseString
- From: Webb <email@hidden>
- Date: Sat, 19 Oct 2002 20:09:58 +0900
Hello all,
I think I must call NSString method "canBeConvertedToEncoding" before
calling "uppercaseString", such as:
...
NSString* aString = [NSString
stringWithContentsOfFile:@"/Users/Webb/test.dat"];
NSString* aConvertedString = nil;
if ( [aString canBeConvertedToEncoding:NSASCIIStringEncoding] ) {
aConvertedString = [aString uppercaseString];
} else {
aConvertedString = @"";
}
...
For some reasons the data of string may come from a image file. If I
call "uppercaseString" directly without calling
"canBeConvertedToEncoding", I will meet an error like this:
*** malloc[2283]: error for object 0x14ca220: Incorrect check sum for
freed object - object was probably modified after beeing freed; break at
szone_error
Is that right, or I missed something? I am using OS 10.1.5
Regards
Webb -
http://www.webbingtec.com
_______________________________________________
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.