How to create a method for posting a notification through the NSNotificationCenter and then call the method through applicationDidFinishLauching main method without any (IBAction) . I just wanted to send only a message.I also dont want the postNotification to be placed in applicationDidFinishLaunching method.
-(void)applicationDidFinishLaunching
{
event=[[SomeClass alloc]init];
}
-(void)sendEvent:(id)sender
{
postNotificationName:... object:---
}
Now i where i need to call this sendEvent method in my program.
How to do it?
The
-postNotificationmethod on NSNotificationCenter is what you’re looking for: