Skip to content

Instantly share code, notes, and snippets.

@chamons
Created May 4, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/284881e679cfc22a3827 to your computer and use it in GitHub Desktop.
Save chamons/284881e679cfc22a3827 to your computer and use it in GitHub Desktop.
public static class NSArrayControllerPatch
{
static readonly IntPtr selSetFilterPredicate_Handle = ObjCRuntime.Selector.GetHandle ("setFilterPredicate:");
[System.Runtime.InteropServices.DllImport ("/usr/lib/libobjc.dylib", EntryPoint="objc_msgSend")]
public extern static void void_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg1);
public static void SetFilterPredicate (this NSArrayController c, NSPredicate p)
{
void_objc_msgSend_IntPtr (c.Handle, selSetFilterPredicate_Handle, p == null ? IntPtr.Zero : p.Handle);
}
}
insetad of PersonsArrayController.SetFilterPredicate (null);
PersonsArrayController.FilterPredicate = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment