Skip to content

Commit

Permalink
Fix init method cause crash
Browse files Browse the repository at this point in the history
  • Loading branch information
livingyang committed May 3, 2012
1 parent 72b98e5 commit 3a05016
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CCTextField.m
Expand Up @@ -52,6 +52,8 @@ - (id)initWithFieldSize:(CGSize)textFieldSize fontName:(NSString *)fontName andF

self.textField = [[[UITextField alloc] initWithFrame:CGRectMake(s.width * 2, s.height * 2, textFieldSize.width, textFieldSize.height)] autorelease];

[self.textField addObserver:self forKeyPath:@"delegate" options:NSKeyValueObservingOptionNew context:NULL];

[[[CCDirector sharedDirector] openGLView] addSubview:self.textField];

[self initContent];
Expand Down

0 comments on commit 3a05016

Please sign in to comment.