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.
UUID (NSUUID、一意の文字列、128 ビット) を数値に変換して SQLite に格納したい (主キーはコア データを使用するため)。
どうすればいいのですか?
Core Data には主キーの概念がなく、必ずしも SQLite をバッキング ストアとして使用するわけではないため、これは不可能です。
UUID 文字列をバイナリに変換する場合は、
uuid_t uuid; NSUUID *uuidString = [[[NSUUID alloc] initWithUUIDString:@"68753A44-4D6F-1226-9C60-0050E4C00067"] autorelease]; [uuidString getUUIDBytes:uuid];