UniqueWindowController.m
changeset 3 8fad19466c59
parent 2 3d3dcc3116d5
child 6 2d492d8c2053
     1.1 --- a/UniqueWindowController.m	Wed Apr 02 14:45:33 2008 -0700
     1.2 +++ b/UniqueWindowController.m	Sun Apr 06 19:13:27 2008 -0700
     1.3 @@ -13,11 +13,17 @@
     1.4  @implementation UniqueWindowController
     1.5  
     1.6  
     1.7 ++ (BOOL) isModel: (id)model1 equalToModel: (id)model2
     1.8 +{
     1.9 +    return model1==model2;
    1.10 +}
    1.11 +
    1.12 +
    1.13  + (UniqueWindowController*) instanceWith: (id)model
    1.14  {
    1.15      for( NSWindow *window in OpenWindowsWithDelegateClass(self) ) {
    1.16          UniqueWindowController *c = window.delegate;
    1.17 -        if( c.model == model )
    1.18 +        if( [self isModel: c.model equalToModel: model] )
    1.19              return c;
    1.20      }
    1.21      return nil;