开发者

Enforcing protocol of a NSNotification

I have a model made up of three objects, a base model object, a specific model object (generalStatus as an example) and an genericXML getter object. The getter object is passed into the model so I can drive test cases without a network. There is a specific controller (genstatusController as an example) for each model pulling data and update the view. The low level genericXML getter uses ASIHttp for its network work, there are run loops and the activity is async. The specific model has a genericXML getter, it will call the getter to update an XML document. There are many upper level models all using the same base model and then a common XML getter object. When the genericXML getter finishes a async request to update an xml data it post a NSNotification to the model. The model will then parse the XML and post a NSNotification to the controller letting it know the data is updated. I 开发者_如何学JAVAhave a couple of protocols between the base objects and specific model. I like this level of enforcement, is there a way to enforce the NSNotification between the sets of objects?

BTW, the controller invokes the refresh of the data but needs to wait on an async event from the model to to tell it the update is done so it can update the view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜