mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-30 20:07:36 +00:00
Merge branch 'master' of github.com:cappuccino/cappuccino
This commit is contained in:
commit
3bc5605633
1 file changed
+13
-11
+13
-11
@@ -66,6 +66,7 @@ var CPViewControllerCachedCibs;
|
||||
{
|
||||
CPView _view @accessors(property=view);
|
||||
BOOL _isLoading;
|
||||
BOOL _isLazy;
|
||||
|
||||
id _representedObject @accessors(property=representedObject);
|
||||
CPString _title @accessors(property=title);
|
||||
@@ -124,6 +125,7 @@ var CPViewControllerCachedCibs;
|
||||
_cibExternalNameTable = anExternalNameTable || [CPDictionary dictionaryWithObject:self forKey:CPCibOwner];
|
||||
|
||||
_isLoading = NO;
|
||||
_isLazy = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -139,8 +141,8 @@ var CPViewControllerCachedCibs;
|
||||
implementation for programmatic views is to create a plain view. You can
|
||||
invoke super to utilize this view.
|
||||
|
||||
If you use Interface Builder to create your views, you initialize the view
|
||||
using the initWithCibName:bundle: method then you must not override this
|
||||
If you use Interface Builder to create your views, and you initialize the view
|
||||
using the initWithCibName:bundle: method, then you MUST NOT override this
|
||||
method. The consequences risk shattering the space-time continuum.
|
||||
|
||||
Note: The cib loading system is currently synchronous.
|
||||
@@ -199,6 +201,11 @@ var CPViewControllerCachedCibs;
|
||||
_isLoading = NO;
|
||||
[self viewDidLoad];
|
||||
}
|
||||
else if (_isLazy)
|
||||
{
|
||||
_isLazy = NO;
|
||||
[self viewDidLoad];
|
||||
}
|
||||
|
||||
return _view;
|
||||
}
|
||||
@@ -208,9 +215,9 @@ var CPViewControllerCachedCibs;
|
||||
This method is called after the view controller has loaded its associated views into memory.
|
||||
|
||||
This method is called regardless of whether the views were stored in a nib
|
||||
file or created programmatically in the loadView method. This method is
|
||||
most commonly used to perform additional initialization steps on views
|
||||
that are loaded from cib files.
|
||||
file or created programmatically in the loadView method, but NOT when setView
|
||||
is invoked. This method is most commonly used to perform additional initialization
|
||||
steps on views that are loaded from cib files.
|
||||
*/
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
@@ -228,13 +235,7 @@ var CPViewControllerCachedCibs;
|
||||
*/
|
||||
- (void)setView:(CPView)aView
|
||||
{
|
||||
var viewWasLoaded = !_view;
|
||||
|
||||
_view = aView;
|
||||
|
||||
// Make sure the viewDidLoad method is called if the view is set directly
|
||||
if (!_isLoading && viewWasLoaded)
|
||||
[self viewDidLoad];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -266,6 +267,7 @@ var CPViewControllerViewKey = @"CPViewControllerViewKey",
|
||||
_cibBundle = bundlePath ? [CPBundle bundleWithPath:bundlePath] : [CPBundle mainBundle];
|
||||
|
||||
_cibExternalNameTable = [CPDictionary dictionaryWithObject:self forKey:CPCibOwner];
|
||||
_isLazy = YES;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
Reference in new issue
Block a user