Created
February 23, 2010 02:07
-
-
Save chandlerkent/311764 to your computer and use it in GitHub Desktop.
"Shadowed" should be alerted.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AppController.j | |
* ShadowingProblem | |
* | |
* Created by Chandler Kent on February 22, 2010. | |
* Copyright 2010, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ | |
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask]; | |
var childObject = [[ChildObject alloc] init]; | |
[theWindow orderFront:self]; | |
} | |
@end | |
// Parent Object | |
@implementation ParentObject : CPObject | |
{ | |
} | |
- (void)doesThisParameterShadow:(CPString)variableToShadow | |
{ | |
// This should be "Shadowed" | |
alert(variableToShadow); | |
} | |
@end | |
// Child Object | |
@implementation ChildObject : ParentObject | |
{ | |
CPString variableToShadow; | |
} | |
- (id)init | |
{ | |
self = [super init]; | |
if(self) | |
{ | |
variableToShadow = @"Not shadowed"; | |
[self doesThisParameterShadow:@"Shadowed"]; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment