Re: NSURLConnection and MVC
Re: NSURLConnection and MVC
- Subject: Re: NSURLConnection and MVC
- From: Chuck Soper <email@hidden>
- Date: Wed, 19 Sep 2012 11:07:03 -0700
- Thread-topic: NSURLConnection and MVC
I haven't implemented what you're describing, but you might want to look
at Marcus Zarra's talk on Flexible JSON Importing. I don't know what
you're parsing (JSON, XML, or something else). I found the slides for
Marcus' Flexible JSON Importing talk here:
http://www.mactech.com/conference/presentations-speaker
The implementation details start around page 26.
Chuck
On 9/19/12 6:42 AM, "Koen van der Drift" <email@hidden> wrote:
>Briefly in my app (OSX), I download data from a database to be
>displayed in a view. I created a Controller that takes care of the
>NSURLConnection, retrieves the data, and sends it to a database model
>class to parse. It also takes care of updating the UI during the
>download ("Download in progress", "Download failed", "Downlaod is
>done", etc). Once that is done, the parsed data is send back to the
>controller to update the view.
>
>I'd like to add another database class that uses a different way to
>obtain the data, it only needs one pass, while the other one needs
>multiple. And of course it needs to be parsed differently. Now I am
>getting into trouble, because the way the controller and original
>database class interact turns out to be very specific for the original
>database. So I need to fix this, obviously, because there could be
>more database classes in the future. Reading up on MVC and
>NSURLConnection, I saw several posts on SO suggesting to put all the
>NSURLConnection stuff in the database (model) class instead of the
>Controller as I have been doing.
>
>Seems like a valid solution to me, I can use notifications to keep the
>controller updated about the download status.
>
>Any thoughts?
>
>- Koen.
>_______________________________________________
>
>Cocoa-dev mailing list (email@hidden)
>
>Please do not post admin requests or moderator comments to the list.
>Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
>Help/Unsubscribe/Update your Subscription:
>
>This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden