• 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
getObjectValue:forString:range:error: not behaving as expected?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getObjectValue:forString:range:error: not behaving as expected?


  • Subject: getObjectValue:forString:range:error: not behaving as expected?
  • From: Prentice Alvin <email@hidden>
  • Date: Sun, 29 May 2011 12:15:33 -0700

Greetings,



When I'm trying to use getObjectValue:forString:range:error: to parse a
string that has a date in it, I'm not getting what I would expect as the
right range back.



For example, in the following code



NSString * substring = @"junk tomorrow";
BOOL gotdate = false;
gotdate = [dateFormatter getObjectValue:&readDate forString:substring
range:&range error:&error];


produces gotdate = YES (so it was able to parse the string and find a date)
and range = 0, 13.



According to the class reference:

*rangep*

If the receiver is able to parse *string*, upon return contains the range
of *string*used to create the date.



My question is why wouldn't range come out to be 5, 13?



Thanks in advance.

-Prentice
_______________________________________________

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

  • Prev by Date: Re: Linearly Scaling Text
  • Next by Date: Re: A Return NSString Problem
  • Previous by thread: Re: A Return NSString Problem
  • Next by thread: Intercepting click on send in Mail.app
  • Index(es):
    • Date
    • Thread