Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CaptSaltyJack

macrumors 6502
Original poster
Jun 28, 2007
351
1
Let's say I want to define a simple class, "Person." Something like:

Code:
class Person : NSObject
{
  NSString *name;
  int age;
  UIImage *portrait;
}

Is it OK to use user interface objects in the Model? Is there some other, better way of attaching a user photo to each person?
 
UIImage is a data object, not a view object. Maybe you meant UIImageView?

It's perfectly reasonable for a Person object to have a reference to a UIImage related to that Person object. It wouldn't be so good for it to have a ref to a UIImageView.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.