Hello,
I am having trouble with NSWindow resizing. I have an NSWindow with an NSView subclass on top of it that fills the entire window. I am drawing this view like so:
When I attempt to resize my window. I get EXC_BAD_ACCESS (code = 1, address=0x13) on [customBackgroundColor set];
Does anyone know what's going on here?
Thanks!
I am having trouble with NSWindow resizing. I have an NSWindow with an NSView subclass on top of it that fills the entire window. I am drawing this view like so:
Code:
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self) {
customBackgroundColor = [NSColor colorWithPatternImage:[NSImage imageNamed:@"background-dark.tiff"]];
}
return self;
}
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
NSGraphicsContext *contetx = [NSGraphicsContext currentContext];
[contetx saveGraphicsState];
[[NSGraphicsContext currentContext]setPatternPhase:NSMakePoint(0, [self frame].size.height)];
[customBackgroundColor set];
NSRectFill([self bounds]);
[contetx restoreGraphicsState];
}
When I attempt to resize my window. I get EXC_BAD_ACCESS (code = 1, address=0x13) on [customBackgroundColor set];
Does anyone know what's going on here?
Thanks!