0
如何创建一个通过NSNotificationCenter发布通知的方法,然后通过不带任何(IBAction)的applicationDidFinishLauching主方法调用该方法。我只想发送一条消息。我也不想将postNotification放置在applicationDidFinishLaunching方法中。如何在Objective-C中创建发布通知的方法?
-(void)applicationDidFinishLaunching
{
event=[[SomeClass alloc]init];
}
-(void)sendEvent:(id)sender
{
postNotificationName:... object:---
}
现在我需要在我的程序中调用这个sendEvent方法。 如何做到这一点?
由于这是实际的答案我想要的。 – Cathy 2010-02-18 04:20:03