title: Using Core Data with Images or buttons (or anything besides a tableView)
body: <p>I'm trying to build an application that uses something like the following data model. I can do this fine in a tableView but I would like to be more creative. For Example, Inside a navigation controller, I want to have a view that has 10 images (or buttons with an image as a background). </p>
  
  <p>(three entities)</p>
  
  <p>entity 1: House</p>
  
  <ul>
  <li>attribute: houseName</li>
  <li>relationship:person </li>
  </ul>
  
  <p>entity 2:Person</p>
  
  <ul>
  <li>attribute: personName</li>
  <li>relationship:house</li>
  <li>relationship:children</li>
  </ul>
  
  <p>entity 3:Children</p>
  
  <ul>
  <li>attribute:name</li>
  <li>attribute:birthPlace</li>
  <li>relationship: adult</li>
  </ul>
  
  <p>relationships are one to many down from
  attributes are all strings</p>
  
  <p>person&lt;---->>house, children&lt;--->>adult</p>
  
  <p>In the first view there are images and each image is assigned to entity House (houseName 1, houseName 2, etc.). When you select a house it pushes the next view with 5 images (that is linked to the Person Entity (personName 1, personName2, etc). When you select the PersonName it will push the next view populated with the Children Entity.</p>
  
  <p>I've read quite a bit of info on core data and I'm comfortable doing this:</p>
  
  <pre><code>NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];
  cell.textLabel.text = [[managedObject valueForKey@"houseName"] description];
  </code></pre>
  
  <p>but very unsure where I should even start with using and image or button to do this</p>
  
  <p>I was thinking of something like this:</p>
  
  <pre><code>-(id)initWithHouseViewController:(HouseViewController*)aHouseViewController house:(NSManagedObject *)aHouse{
  if blah blah
  self.houseViewController = aHouseViewController;
  self.house = aHouse
    }return self;
  }
  </code></pre>
  
  <p>// for a selector</p>
  
  <pre><code> -(void) showPersonView{
  PersonViewController *pvc = [[PersonViewController alloc] initWithHouseViewController:self house:house];
  </code></pre>
  
  <p>in the viewDidLoad</p>
  
  <pre><code>{
  if (house != nil) {
  UIImageView *house1 = [[ UIImageView alloc.. blah blah
  some kind of..  action:@selector(showPersonView)
  ((for each houseName in house) instead of house1, house2,)
  ...
  }
  </code></pre>
  
  <p>Any suggestions with the viewDidLoad where I wouldn't need to hard code in each image (or button) would be great to make this more portable. Also, I'm not rooted to doing it this way if there are suggestions as to a nicer/more creative way to do this.</p>
  
  <p>Sorry if this is a bit messy. It's messy in my mind as well. </p>
  
  <p>Thanks for taking your time to read this,</p>