Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Chapter 8 - Cells Part II question

The archived code doesn't have the Cells Part II code.  My issue is that my table shows correctly, but the contents of the right hand labels (nameValue and colorValue) are empty.  I put an alert into cellforRowAtIndexPath to display and cell.color.  I'm populating those properly, but nothing gets displayed when I run it.  Any thoughts?


  • Hmmm. Nothing springs to mind, but maybe you should post the entire .m file, maybe I (or someone else) can spot the problem.
  • Experiencing exactly the same problem. 

    I Placed an NSLog(@"rowData = %@", rowData); after = rowData[@"Name"]; and cell.color = rowData[@"Color"];
    and the output shows the correct name and color are being sent to the cell object.
    I also placed an NSLog(@"name = %@", _name);within the setName method which gives me an output of 
    2013-07-08 08:36:46.764 Cells[1390:c07] name = Mac Pro

    2013-07-08 08:36:46.764 Cells[1390:c07] name = (null)

    I guess it's something to do with the second line, name  = (null) but cant figure out why the method is being called again and why the second time its equal to null.


  • Doh!
    Found my mistake, the method setName was being called twice, once for the setting the name, then I was using it again to set the color instead of setColor, the reason the name value was returning null was because I was also using the dictionary key @"colour" instead of @"color". My default English causing me problems.

    I do however have one quick question, within the setName method I can substitute _name with [self name] for both of the following instances (![n]) and 
    nameValue.text = self.namebut when I use it in the following line of code = [n copy];
    the app crashes, could some kind person explain why. 

Sign In or Register to comment.