Exemple #1
0
        /// <summary>
        /// Creates and returns a predicate that always evaluates to a given Boolean value.
        /// </summary>
        /// <returns>The with value.</returns>
        /// <param name="value">If set to <c>true</c> value.</param>
        public static NSPredicate PredicateWithValue(bool value)
        {
            NSPredicate predicate = null;
            var         ptr       = C.NSPredicate_predicateWithValue(value);

            if (PInvokeUtil.IsNotNull(ptr))
            {
                predicate = new NSPredicate(ptr);
                CFFunctions.CFRelease(ptr);
            }
            return(predicate);
        }
Exemple #2
0
        /// <summary>
        /// Creates and returns a new predicate formed by creating a new string with a given format and parsing the result.
        /// </summary>
        /// <returns>The with format.</returns>
        /// <param name="predicateFormat">Predicate format.</param>
        public static NSPredicate PredicateWithFormat(NSString predicateFormat)
        {
            if (predicateFormat == null)
            {
                return(null);
            }

            NSPredicate predicate = null;
            var         ptr       = C.NSPredicate_predicateWithFormat(predicateFormat.ToPointer());

            if (PInvokeUtil.IsNotNull(ptr))
            {
                predicate = new NSPredicate(ptr);
                CFFunctions.CFRelease(ptr);
            }
            return(predicate);
        }