Skip to content

Instantly share code, notes, and snippets.

View sadatrahman's full-sized avatar

Sadat Rahman sadatrahman

  • Melbourne, Australia
View GitHub Profile
@sadatrahman
sadatrahman / gist:1234895
Created September 22, 2011 14:26 — forked from orj/gist:1234366
A macro to declare a variable number of Objective-C properties in one statement.
#define CAT(a, b) _PRIMITIVE_CAT(a, b)
#define _PRIMITIVE_CAT(a, b) a##b
#define N_ARGS(...) N_ARGS_1(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
#define N_ARGS_1(...) N_ARGS_2(__VA_ARGS__)
#define N_ARGS_2(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, n, ...) n
#define PROPERTY(policy, ...) CAT(_PROPERTY_, N_ARGS(__VA_ARGS__))(policy, __VA_ARGS__)
#define PROPERTY_STRONG(...) PROPERTY(retain, __VA_ARGS__)
#define PROPERTY_WEAK(...) PROPERTY(assign, __VA_ARGS__)
//
// TTTableViewDelegateCategory.m
// DELETEME
//
// Created by Mike on 5/6/10.
// Copyright 2010 Prime31 Studios. All rights reserved.
//
#import "TTTableViewDelegateCategory.h"