Previous | Next | WireHose Developers Guide |
Next, we'll add a property that controls whether or not to import feeds at runtime, and actually call the importer.
# controls whether feeds are imported # when the application starts up ImportFeeds = NO
NSNotificationCenter.defaultCenter().addObserver( this, new NSSelector("initialize", new Class[] { NSNotification.class } ), WHApplicationHelper.ApplicationHelperDidFinishInitializing, null);
WireHose provides an object called the WHApplicationHelper to
handle application-level behavior. Among other tasks,
WHApplicationHelper handles various initialization and setup
tasks. Once it's done, it posts an
ApplicationHelperDidFinishInitializing
notification
which indicates that it's now safe to access WireHose tags and
other data structures.
public void initialize(NSNotification notification) { if (NSPropertyListSerialization.booleanForString( System.getProperty("ImportFeeds"))) { Importer.importFeeds(); } }
If the "ImportFeeds" property evaluates to true (or "YES"), then the importer will run.
Copyright ©2000-2003 Gary Teter. All rights reserved. WireHose is a trademark of Gary Teter.