How can I compare two CFUUIDRefs from the CoreFoundation Carbon framework in Mac OS X? Is there an easier way to check if two CFUUIDs are equal other than converting them to strings and then comparing those?
How do I compare two CFUUIDs (Mac OS X Carbon/CoreFoundation)?
1.3k views Asked by Jake Petroules At
2
There are 2 answers
1
Aidan Steele
On
I'm not sure if there is a canonical or recommended method per se, but would the following suffice?
#define CompareUUIDs(u1, u2) memcmp(CFUUIDGetUUIDBytes(u1), CFUUIDGetUUIDBytes(u2))
It would be used as follows:
if (CompareUUIDs(u1, u2) == 0) {
// UUIDs are equal
} // etc..
Alternatively, as you're only really interested in whether they are equal or not:
#define UUIDsAreEqual(u1, u2) (memcmp(CFUUIDGetUUIDBytes(u1), CFUUIDGetUUIDBytes(u2)) == 0)
It would be used as follows:
if (UUIDsAreEqual(u1, u2)) {
// UUIDs are equal
} // etc..
Related Questions in OBJECTIVE-C
- How to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
Related Questions in MACOS
- Error installing Nativescript on Mac M2 Sonoma 14.4.1
- macOS - Most secure way of a GUI SUDO_ASKPASS
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- ZSH function parameters conundrum
- how to make read only file/directory in Mac writable
- macOS BigSur - Unable to run bundled php version or brew php 8
- 9 Digit Addresses in Hexadecimal System in MacOS
- MacOS Bash-Script: while read p and echo
- How to make a range for tail rows on a categorized table in Numbers with JXA scripts?
- Cannot build a basic project with curl on Mac (M2) for Raspberry Pi Pico
- How to recover deleted files from create vite react project
- Can't run built SFML project from Xcode template
- React Native - RealmJS - Linker command failed with exit code 1
- How can I manually add a keyboard shortcut to a Shortcut Action Service directly via the system files, without going through the System Prefs GUI?
Related Questions in MACOS-CARBON
- In the Text Encoding Converter API, what on earth is a MIB?
- How to find out if PBXLockRange() and file locking would work on a given volume in 64bit carbon?
- Convert CFArray to pointer
- Detecting the layout of an internal Apple hardware keyboard
- macOS: Override Modifier Key with CGEventTap
- AppKit/CoreServices KeyCode and keyboard mapping (without NSEvent)
- Why do I need to keep re-enabled Accessibility for my mac whenever I compile a new version?
- Possible to read keyboard shortcuts table in macOS?
- Swift: Listen for global shortcut on specific keyboard
- Swift UnsafeMutableRawPointer returns class instead of instance
- macOS Catalina - Onscreen (virtual) Keyboard not working
- Is it okay to use carbon api's that works on 64-bit macOS
- Using AppleScript with Apple Events in macOS - Script not working
- Why does `#import <HIToolbox/Events.h>` fail?
- 64 bit Migration of Carbon APIs
Related Questions in UUID
- Implementing UUID as primary key in Laravel intermediate table
- Use data type uuid or varchar(36) for my UUID column?
- How do you check if self.crypto.randomUUID() is available in Javascript?
- Invalid Input for type integer when my input should be a uuid
- symfony doctrine uuid on maria not working
- Approach to generate Short Unique key like (AboU8N) in distributed environment?
- Why is the UUID split into chunks like XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX?
- How to generate/pass unique UUID to Threads independent of each other in JMeter's Stepping Thread Group
- get values(pressure blood) from ble device in flutter
- ERROR TypeError: window.crypto.randomUUID is not a function - Angular
- Error loading from bundle using a file located in the projected
- Unable to find 128 bit characteristic UUID using Zephyr Heart Rate Service
- How can we get 2 UUID for Same device for same iOS App without Delete or Re-Install the same App?
- How to find by UUID in MongoDB
- Results from dplyr::join on UUID column differ between Linux and Mac OS
Related Questions in CORE-FOUNDATION
- How to check if the current user is admin from macOS Xcode using swift?
- How to get the name and window id of the current in focus window on macOS and change its position in rust?
- How to find out if PBXLockRange() and file locking would work on a given volume in 64bit carbon?
- CleanupRecodeProperties:3604 Error Message Meaning
- Casting Objective-c to CoreFoundation is disallowed. Looking for alternatives
- I want to print hello before CoreFoundation.dylib loads in ios
- Using CF_SWIFT_NAME to import a C struct getter and setter that bridges to Foundation from Core Foundation
- Can I use CoreFoundation and Foundation methods in C++ in a iOS app
- PCH was compiled with module cache path Issue
- Why does a Python request from Firebase Cloud Functions result in a CoreFoundation error?
- Issues creating multiple timers with CFRunLoopTimerCreate
- Overriding qHash() using a hashing function without a seed
- Safe to set CGEvent user data field?
- Convert *const __CFData to String in Rust
- File change notifications for macOS using C++
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
A CFUUID is a kind of CFType, so you would use the same CFEqual function you use for any other CF objects.