<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" > </div>
<div dir="ltr" >Hello</div>
<div dir="ltr" > </div>
<div dir="ltr" >I am running a sample program on OSx to adjust the Ranges within an NSTextCheckingResult object using the api .resultByAdjustingRangesWithOffset(). Below is the output when I give the offset as '922337203685477580'<b> </b>. <strong><em>See Output 1:</em></strong> I see that the location field of the range is modified to a negative (signed) integer when it goes beyond Int.max. Wondering if this is deliberately done and working as expected OR this should fail as an invalid argument exception (similar to the case seen when the offset passed causes the modified location to go less than 0 ie. negative. <strong><em>See Output 2:</em></strong> )</div>
<div dir="ltr" > </div>
<div dir="ltr" ><strong>Output 1:</strong></div>
<div dir="ltr" >-----------------------------------------------------------------------------------</div>
<div dir="ltr" ><div>Ranges: </div>
<div>(5, 2)</div>
<div>(9223372036854775807, 0)</div>
<div>(5, 1)</div>
<div>Calling: .resultByAdjustingRangesWithOffset(9223372036854775807)</div>
<div>Adjusted ranges:</div>
<div>(<strong>-9223372036854775804</strong>, 2)</div>
<div>(9223372036854775807, 2)</div>
<div>(<strong>-9223372036854775804</strong>, 2)</div>
<div>-----------------------------------------------------------------------------------</div>
<div> </div>
<div><strong>Output 2:</strong></div>
<div>-----------------------------------------------------------------------------------</div>
<div><div>Ranges: </div>
<div>(5, 2)</div>
<div>(9223372036854775807, 0)</div>
<div>(5, 1)</div>
<div>Calling: .resultByAdjustingRangesWithOffset(-6)</div>
<div>Adjusted ranges:</div>
<div>2016-06-06 15:55:44.358 TestProject[5628:211197] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSSimpleRegularExpressionCheckingResult resultByAdjustingRangesWithOffset:]: <strong>-6 invalid offset for range {5, 2}'</strong></div>
<div>*** First throw call stack:</div>
<div> :</div>
<div> :</div>
<div>-----------------------------------------------------------------------------------</div>
<div> </div>
<div>Any help on understanding the expected output is appreciated.</div>
<div> </div>
<div>Thank you.</div>
<div> </div>
<div>Regards</div>
<div>Mamatha</div>
<div> </div></div>
<div> </div></div></div><BR>