Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Author: thakis]

Make implicit assumptions in GTMWindowSheetController explicit by
adding asserts.

Original review at http://codereview.appspot.com/4418041/

R=avi
APPROVED=avi
DELTA=8  (6 added, 0 deleted, 2 changed)

git-svn-id: http://google-toolbox-for-mac.googlecode.com/svn/trunk@440 7dc7ac4e-7543-0410-b95c-c1676fc8e2a3
  • Loading branch information...
commit b570575a4f27004d9209821dbf2056e3d12590dc 1 parent 440fc73
gtm.daemon authored
View
7 AppKit/GTMWindowSheetController.h
@@ -74,8 +74,11 @@
delegate:(id <GTMWindowSheetControllerDelegate>)delegate;
// Starts a view modal session for a sheet. Intentionally similar to
-// -[NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:
-// contextInfo:].
+// -[NSApplication
+// beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:].
+// You must only call this method if the currently active view is |view| or
+// |nil|; this means you can call this method only after creating the
+// GTMWindowSheetController or after calling -setActiveView:view.
//
// Args:
// sheet: The window object representing the sheet you want to
View
3  AppKit/GTMWindowSheetController.m
@@ -339,6 +339,9 @@ - (void)beginSystemSheet:(id)systemSheet
}
[invocation invokeWithTarget:systemSheet];
+ _GTMDevAssert(!activeView_ || activeView_ == view,
+ @"You have to call setActiveView:view before "
+ "calling beginSheet:modalForView:view");
activeView_ = view;
}
Please sign in to comment.
Something went wrong with that request. Please try again.