Skip to content

Instantly share code, notes, and snippets.

@cremaschi
cremaschi / NSPredicate+Distinct.h
Created November 12, 2013 01:51
A category on the NSPredicate to add the distinct function. You can easily create a predicate that removes duplicates in an array just passing the property name you want to check.
//
// NSPredicate+Distinct.h
//
// Created by Maurizio Cremaschi on 11/11/2013.
// Copyright (c) 2013 Myfleek Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSPredicate (Distinct)
@cremaschi
cremaschi / NSError+NoConnection.h
Created November 12, 2013 01:55
A category on the NSError to check if it's a "No Internet Connection" error. For example you can use it on a network request completion to display a proper message.
//
// NSError+NoConnection.h
//
// Created by Maurizio Cremaschi on 01/11/2013.
// Copyright (c) 2013 Myfleek Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSError (NoConnection)