Skip to content

Instantly share code, notes, and snippets.

@maxhuk
Created April 9, 2013 09:42
Show Gist options
  • Save maxhuk/5344442 to your computer and use it in GitHub Desktop.
Save maxhuk/5344442 to your computer and use it in GitHub Desktop.
Useful macros for working with notifications.
//
// NSNotificationCenter+Macros.h
//
// Created by Maksym Huk on 3/31/13.
// Copyright (c) 2013 Maksym Huk. All rights reserved.
//
#define NOTIFICATION_H(x) extern NSString * const x;
#define NOTIFICATION_M(x) NSString * const x = @#x;
#define OBSERVE_NOTIFICATION(notificationName, sel) [[NSNotificationCenter defaultCenter] addObserver:self selector:sel name:notificationName object:nil]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment