I created a custom subclass of NSView in order to control 2 NSImageViews. The code for creating the images is as follows:
- (id)initWithFrame:(NSRect)frameRect AndMap:(NSImage *)map AndPlayer:(NSImage *)guyImage
{
self = [super initWithFrame:frameRect];
if (self)
{
NSRect newRect = NSMakeRect(0.0, 0.0, 64.0, 64.0);
NSImageView *theMap = [[NSImageView alloc] initWithFrame:NSMakeRect(0.0, 0.0, frameRect.size.width, frameRect.size.height)];
[theMap setImage:map];
NSImageView *theGuy = [[NSImageView alloc] initWithFrame:newRect];
[theGuy setImage:guyImage];
[self setMapImage:theMap];
[self setPlayerView:theGuy];
[self addSubview:[self mapImage]];
[self addSubview:[self playerView]];
However, when I tell the view to draw in a rect with origin (128,0), it draws theMap with a weird offsets, so that theGuy's origin is at 128,0, but theMap's origin is at something like (128,20). I can't find any reason why this should occur.