开发者

Enforcing protocol of a NSNotification

开发者 https://www.devze.com 2023-04-12 02:21 出处:网络
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

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

精彩评论

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

关注公众号