getObjectValue:forString:range:error: not behaving as expected?
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