• 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
About NSString - uppercaseString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: About NSString - uppercaseString
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Icons in outlines
  • Next by Date: Re: Directory Enumeration in Cocoa
  • Previous by thread: Re: Icons in outlines
  • Next by thread: Re: About NSString - uppercaseString
  • Index(es):
    • Date
    • Thread