在textview做字?jǐn)?shù)限制時(shí)仰禽,在iOS7下輸入漢字時(shí),一旦長(zhǎng)度到達(dá)最大長(zhǎng)度,再進(jìn)行輸入(此時(shí)輸入狀態(tài)還是拼音)就會(huì)立即崩潰.
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray replaceObjectsInRange:withObject:length:: Out of bounds'
話不多說(shuō)汽久,直接上代碼。
在處理iOS7問(wèn)題中弧腥,rangeOfComposedCharacterSequenceAtIndex:和rangeOfComposedCharacterSequencesForRange:是NSString中遍歷字符串每一個(gè)字符的方法。這是一個(gè)iOS7上的bug纤怒。