Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
内部で UTF16 エンコーディングを使用する NSString があります。UTF32 を使用するように変換して、 or q両方が単一のインデックスを取得するようにします。Currenty は 2 かかります。
or q
これを行う方法 ?。NSString から他の型に変換できたとしても、動作します。肝心 or qなのは、配列内で同じ数のインデックスを取得することです。
試しましたか :
NSData *data = [string dataUsingEncoding:NSUTF32StringEncoding]; NSString *convertedString = [[NSString alloc] initWithData:data encoding:NSUTF32StringEncoding];