I'm doing the challenge exercises in Aaron Hillegass' book Cocoa Programming for Mac.
What I'm trying to do is have a window resize to twice the height of the width. Here is my code so far.

```
#import "AppController.h"

@implementation AppController

-(id) init
{
    [super init];
    NSLog(@"init");
    [window setDelegate:self];
    return self;
}

-(NSSize) windowWillResize:(NSWindow*) sender
toSize:(NSSize)frameSize
{
    int x;
    NSSize mySize;
    mySize.width = x;
    mySize.height = 2*x;
    NSLog(@"mySize is %f wide and %f tall",mySize.width,mySize.height);
    return mySize;
}

```

This does not work as intended I'm sure I'm not using the NSSize type correctly. I don't know a lot of C so using the struct is where I think I'm making my mistake.

ADDENDUM: I changed the above code to the following.I know that I'm being passed an NSSize so there is no reason to create another one (i.e. mySize).However, I don't understand why this works. Can someone explain.

```
#import "AppController.h"

@implementation AppController

-(id) init
{
    [super init];
    NSLog(@"init");
    [window setDelegate:self];
    return self;
}

-(NSSize) windowWillResize:(NSWindow*) sender
toSize:(NSSize)frameSize
{
    //float x = 100;
    //NSSize mySize;
    //mySize.width = x;
    //mySize.height = x * 2;
    //NSLog(@"mySize is %f wide and %f tall",mySize.width,mySize.height);
    NSLog(@"mySize is %f wide and %f tall",frameSize.width,frameSize.height);
    return NSMakeSize(frameSize.width, frameSize.width * 2);

}
@end

```