How to create an object of NSNotification in Objective-C?
objective-c
Solution
From the NSNotification documentation:
You can create a notification object with the class methods `notificationWithName:object:` or `notificationWithName:object:userInfo:`. However, you don’t usually create your own notifications directly. The NSNotificationCenter methods `postNotificationName:object:` and `postNotificationName:object:userInfo:` allow you to conveniently post a notification without creating it first.
Problem
I want to create an object of NSNotification as say: ``` NSNotification *obj=[[NSNotification alloc]init]; ``` but when i create like this i get an exception as 'NSConcreteNotification init: is not allowed'. How should i solve this problem?