有问题的代码如下。[我希望]这个问题在上面的问题中得到了完整的概述。提前致谢。MJB。
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
var some_string:NSString = "one"
func application ( application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]? ) -> Bool
{
println("init...")
self.addObserver( self, forKeyPath: "some_string", options: nil, context: nil )
self.some_string = "two"
return true
}
override func observeValueForKeyPath ( keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer<Void> )
{
println("observeValueForKeyPath...")
}
}