fix crash when setting title while to content view is set

This commit is contained in:
Antoine Mercadal committed 2012-01-16 14:19:09 +01:00
1 parent 0c72c52ba2
commit eafbebcebb
1 file changed
+4
+4
View File
@@ -352,6 +352,7 @@ CPBelowBottom = 6;
[_titleView setAutoresizingMask:CPViewMinYMargin];
break;
}
[self sizeToFit];
[self setNeedsDisplay:YES];
}
@@ -361,6 +362,9 @@ CPBelowBottom = 6;
var contentFrame = [_contentView frame],
offset = [self _titleHeightOffset];
if (!contentFrame)
return;
[_contentView setAutoresizingMask:CPViewNotSizable];
[self setFrameSize:CGSizeMake(contentFrame.size.width + _contentMargin.width * 2,
contentFrame.size.height + _contentMargin.height * 2 + offset[0])];