Type Alias objc_sys::NSInteger

source ·
pub type NSInteger = isize;
Expand description

A signed integer value type.

This is guaranteed to always be a type-alias to isize. That means it is valid to use #[repr(isize)] on enums and structs with size NSInteger.

See also the corresponding documentation entry.

§Examples

use core::mem::size_of;
use objc2::ffi::NSInteger;

#[repr(isize)]
pub enum NSComparisonResult {
    NSOrderedAscending = -1,
    NSOrderedSame = 0,
    NSOrderedDescending = 1,
}

assert_eq!(size_of::<NSComparisonResult>(), size_of::<NSInteger>());