• 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
NSString subStringToIndex gives EXC_BAD_ACCESS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString subStringToIndex gives EXC_BAD_ACCESS


  • Subject: NSString subStringToIndex gives EXC_BAD_ACCESS
  • From: Gregor Brandt <email@hidden>
  • Date: Fri, 09 Nov 2007 15:45:32 -0700

The following code snippet compiles fine but gives an bad access error on run....any ideas


NSString *projectName; NSString *title = @"This is a test";

// and parse the project name to remove the [TM] from the end
NSUInteger realLength = title.length - 4;
if ( realLength > 0 )
{
[projectName initWithString:[title substringToIndex:realLength]];
}



Thanks

Gregor

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString subStringToIndex gives EXC_BAD_ACCESS
      • From: "I. Savant" <email@hidden>
    • Re: NSString subStringToIndex gives EXC_BAD_ACCESS
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: SenTestingKit fails when using CG-Only
  • Next by Date: Re: NSString subStringToIndex gives EXC_BAD_ACCESS
  • Previous by thread: Re: NSTreeNode/representedObject
  • Next by thread: Re: NSString subStringToIndex gives EXC_BAD_ACCESS
  • Index(es):
    • Date
    • Thread