Question: I am a beginner in Objective-C and do struggle a bit with dictionaries and arrays.

My goal is to create a table view where every cell contains a picture from a server. The url for the pic comes from a JSON call. I downloaded the example from Apple called "lazy table view" and tried to merge it with the one I found inside a Standford iOS Class. So far everything works, besides the picture. Xcode throws the following exception, once I try to access the icon: 

```
-[__NSCFDictionary Icon]: unrecognized selector sent to instance 0x10b845ff0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary Icon]: unrecognized selector sent to instance 0x10b845ff0'

```

The code in question looks like this:

```
@interface FlickrPhotosTVC : UITableViewController
@property (nonatomic, strong) NSArray *photos; 
@end

@interface ClRecord : NSObject
@property (nonatomic, strong) UIImage *Icon;
#define FLICKR_PHOTO_TITLE @"title"

ClRecord *clRecord = self.photos[indexPath.row];
cell.textLabel.text = [clRecord valueForKeyPath:FLICKR_PHOTO_TITLE]; // works
if (clRecord.Icon) NSLog(@"test"); // throws exeption

```

Somehow this seems to be releated with the types. Trying to access an array, while accesing a dictionory or similar. I found some releated posts on stack, but could not solve it so far.

Thank you for any help!

Answer: 
The code pad allows you to run some code and instantiate objects. It is helpful for testing small bits of code, but not the type of tool that allows for complete methods as far as I understand. The code pad can be accessed under View -> Show code pad.
Sorry, I'm not able to comment on answers yet - you can write as much code in the code pad as you want, really, probably including full methods if you really wanted to - the only differences between the code pad and regular coding are 1. You don't need to write any 'boilerplate', ie code does not have to be in a method or class structure, and 2., BlueJ will evaluate each line as you enter it, rather than all at once.

Don't forget that SHIFT + ENTER goes to the next line without 'sending' what you've typed to the compiler, too - though in most cases you can write line-by-line, this can help you practice formatting and keep multiple statements (with semicolons of course) from getting unreadable and confusing to debug.

Just as a proof-of-concept, try the below out in the BlueJ codepad. It should work either as one block (using shift+enter) OR as a series of individual lines:

```
    int apples = 5; 
    int pears = 4;
    int fruit = apples + pears;
    System.out.println("we have " + apples + " apples and " + pears + " pears.");
    System.out.println("that's " + fruit + " pieces of fruit");

```

It seems, however, that while coming up with examples I've found a limitation. While `if (apples > pears) System.out.println("We have more apples than pears");` works fine, it doesn't seem to like me adding an else statement. But if/else statements are probably reaching the threshold where you are better off writing your code out properly, anyway. The code pad is more useful for "how does this work" type of queries that beginners like us tend to have, or to test an individual line before putting it into your method. I often use it to experiment with formatting/structure problems like "is it possible to do evaluations within a println statement" (It is - in the above example we could have just had `System.out.println("that's " + (apples + pears) + " pieces of fruit");`