diff options
-rw-r--r-- | AppKit/GTMUILocalizer.m | 4 | ||||
-rw-r--r-- | iPhone/GTMUILocalizer.h | 6 | ||||
-rw-r--r-- | iPhone/GTMUILocalizer.m | 17 |
3 files changed, 18 insertions, 9 deletions
diff --git a/AppKit/GTMUILocalizer.m b/AppKit/GTMUILocalizer.m index ffcc11d..9f252e7 100644 --- a/AppKit/GTMUILocalizer.m +++ b/AppKit/GTMUILocalizer.m @@ -57,6 +57,10 @@ } else { _GTMDevLog(@"Expected an owner_ set for %@", self); } + // Won't need these again, clear them. + owner_ = nil; + otherObjectToLocalize_ = nil; + yetAnotherObjectToLocalize_ = nil; } + (NSBundle *)bundleForOwner:(id)owner { diff --git a/iPhone/GTMUILocalizer.h b/iPhone/GTMUILocalizer.h index 3d5552b..d34c4d0 100644 --- a/iPhone/GTMUILocalizer.h +++ b/iPhone/GTMUILocalizer.h @@ -65,9 +65,9 @@ id yetAnotherObjectToLocalize_; NSBundle *bundle_; } -@property(retain) IBOutlet id owner; -@property(retain) IBOutlet id otherObjectToLocalize; -@property(retain) IBOutlet id yetAnotherObjectToLocalize; +@property(nonatomic, assign) IBOutlet id owner; +@property(nonatomic, assign) IBOutlet id otherObjectToLocalize; +@property(nonatomic, assign) IBOutlet id yetAnotherObjectToLocalize; - (id)initWithBundle:(NSBundle *)bundle; diff --git a/iPhone/GTMUILocalizer.m b/iPhone/GTMUILocalizer.m index 274eb04..efebc42 100644 --- a/iPhone/GTMUILocalizer.m +++ b/iPhone/GTMUILocalizer.m @@ -47,15 +47,20 @@ } - (void)awakeFromNib { - if (owner_) { - NSBundle *newBundle = [[self class] bundleForOwner:owner_]; + id owner = self.owner; + if (owner) { + NSBundle *newBundle = [[self class] bundleForOwner:owner]; bundle_ = [newBundle retain]; - [self localizeObject:owner_ recursively:YES]; - [self localizeObject:otherObjectToLocalize_ recursively:YES]; - [self localizeObject:yetAnotherObjectToLocalize_ recursively:YES]; + [self localizeObject:self.owner recursively:YES]; + [self localizeObject:self.otherObjectToLocalize recursively:YES]; + [self localizeObject:self.yetAnotherObjectToLocalize recursively:YES]; } else { - _GTMDevLog(@"Expected an owner_ set for %@", self); + _GTMDevLog(@"Expected an owner set for %@", self); } + // Clear the outlets. + self.owner = nil; + self.otherObjectToLocalize = nil; + self.yetAnotherObjectToLocalize = nil; } + (NSBundle *)bundleForOwner:(id)owner { |