-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTabModel.m
More file actions
54 lines (40 loc) · 1.02 KB
/
Copy pathTabModel.m
File metadata and controls
54 lines (40 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// TabModel.m
// Scribbler
//
// Created by Thomas Nägele on 17.07.10.
// Copyright 2010 xonic. All rights reserved.
//
#import "TabModel.h"
@implementation TabModel
@synthesize view;
- (id)initWithParent:(WindowModel *)theParent
{
if(![super init])
return nil;
if(theParent == nil){
NSLog(@"TabModel/initWithParent:theParent - ERROR: theParent was nil.");
[self release];
return nil;
}
parent = [theParent retain];
// create a new SketchView
// (the corresponding SketchModel
// will be created by the init method itself)
view = [[SketchView alloc] initWithController:[parent controller] andTabModel:self];
return self;
}
- (id)initWithView:(SketchView *)theView andParent:(WindowModel *)theParent
{
if(![super init])
return nil;
if(theView == nil || theParent == nil){
NSLog(@"TabModel/initWithView:theView andParent:theParent - ERROR: one of the parameters was nil.");
[self release];
return nil;
}
view = [theView retain];
parent = [theParent retain];
return self;
}
@end