Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 10-23-2009, 08:34 AM   #16 (permalink)
jazztpt
Registered Member
 
Join Date: Jun 2009
Posts: 32
jazztpt is on a distinguished road
Default

Quote:
Originally Posted by colionel View Post
No this is definitly wrong. A widget writing in core data is a big big mistake. A view should never interact with your model !
If you want to follow the MVC pattern....
I am following the MVC pattern. I don't think my approach is so wrong, and I think I may be confusing the issue by saying that I am subclassing UIView. I'm only subclassing UIView or UIImageView because these widgets have a skin, but really it should be an NSObject that contains a UIView/UIImageView. (Each of these widgets has subviews, so I felt it was simpler to subclass UIView rather than creating one extra level of objects...I don't think that really matters. The MVC views are created with nibs.)

In my MVC architecture, I simply have an extra controller level: the widget controller. So in my architecture, sometimes the "view controller" (a controller that controls an entire screen) interacts with Core Data, and other times a "widget controller" (a controller that controls only a small functional object on the screen) interacts with Core Data.

The view level is changed by nibs and images, and is still separate from the control level. I just don't see why it is important to pass everything that interacts with a functional object on the screen through the UIViewController subclass. Some functionality affects only a small widget object (and can get info from/set info in Core Data); other functionality impacts the entire screen.

These two levels should be separate. Otherwise your UIViewController subclasses become bloated simply passing data back and forth that has nothing to do with them. They should create the objects that are on the screen, passing them any data they need, and then receive only messages that affect the screen: navigation, modal views, table updates, etc.
jazztpt is offline   Reply With Quote
 

» Advertisements
» Online Users: 546
19 members and 527 guests
Apptronics RBC, Bryan1, chiataytuday, DaveDee, ilmman, jmorregoc, LEARN2MAKE, mariano_donati, mediaspree, mox, mpsventas, Newbie123, newprogrammer, oceanlablight, Simba, skrew88, Speed, tommiss12
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,317
Threads: 93,990
Posts: 402,423
Top Poster: BrianSlick (7,978)
Welcome to our newest member, tommiss12
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:10 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.