From 475912cfe7f691a48867027779b73949a7faeb89 Mon Sep 17 00:00:00 2001 From: nimomeng Date: Sun, 11 Sep 2016 19:30:30 +0800 Subject: [PATCH] modify for ARC --- src/org/puremvc/objectivec/core/Controller.h | 0 src/org/puremvc/objectivec/core/Controller.m | 6 +++--- src/org/puremvc/objectivec/core/Model.h | 0 src/org/puremvc/objectivec/core/Model.m | 4 ++-- src/org/puremvc/objectivec/core/View.h | 0 src/org/puremvc/objectivec/core/View.m | 2 -- src/org/puremvc/objectivec/interfaces/ICommand.h | 0 src/org/puremvc/objectivec/interfaces/IController.h | 0 src/org/puremvc/objectivec/interfaces/IFacade.h | 0 src/org/puremvc/objectivec/interfaces/IMediator.h | 0 src/org/puremvc/objectivec/interfaces/IModel.h | 0 src/org/puremvc/objectivec/interfaces/INotification.h | 0 src/org/puremvc/objectivec/interfaces/INotifier.h | 0 src/org/puremvc/objectivec/interfaces/IObserver.h | 0 src/org/puremvc/objectivec/interfaces/IProxy.h | 0 src/org/puremvc/objectivec/interfaces/IView.h | 0 .../puremvc/objectivec/patterns/command/MacroCommand.h | 0 .../puremvc/objectivec/patterns/command/MacroCommand.m | 6 +++--- .../puremvc/objectivec/patterns/command/SimpleCommand.h | 0 .../puremvc/objectivec/patterns/command/SimpleCommand.m | 2 +- src/org/puremvc/objectivec/patterns/facade/Facade.h | 0 src/org/puremvc/objectivec/patterns/facade/Facade.m | 4 ++-- src/org/puremvc/objectivec/patterns/mediator/Mediator.h | 0 src/org/puremvc/objectivec/patterns/mediator/Mediator.m | 9 ++++----- .../puremvc/objectivec/patterns/observer/Notification.h | 0 .../puremvc/objectivec/patterns/observer/Notification.m | 9 ++++----- src/org/puremvc/objectivec/patterns/observer/Notifier.h | 0 src/org/puremvc/objectivec/patterns/observer/Notifier.m | 2 +- src/org/puremvc/objectivec/patterns/observer/Observer.h | 0 src/org/puremvc/objectivec/patterns/observer/Observer.m | 3 +-- src/org/puremvc/objectivec/patterns/proxy/Proxy.h | 0 src/org/puremvc/objectivec/patterns/proxy/Proxy.m | 9 ++++----- 32 files changed, 25 insertions(+), 31 deletions(-) mode change 100644 => 100755 src/org/puremvc/objectivec/core/Controller.h mode change 100644 => 100755 src/org/puremvc/objectivec/core/Controller.m mode change 100644 => 100755 src/org/puremvc/objectivec/core/Model.h mode change 100644 => 100755 src/org/puremvc/objectivec/core/Model.m mode change 100644 => 100755 src/org/puremvc/objectivec/core/View.h mode change 100644 => 100755 src/org/puremvc/objectivec/core/View.m mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/ICommand.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IController.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IFacade.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IMediator.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IModel.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/INotification.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/INotifier.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IObserver.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IProxy.h mode change 100644 => 100755 src/org/puremvc/objectivec/interfaces/IView.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/command/MacroCommand.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/command/MacroCommand.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/command/SimpleCommand.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/command/SimpleCommand.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/facade/Facade.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/facade/Facade.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/mediator/Mediator.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/mediator/Mediator.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/observer/Notification.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/observer/Notification.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/observer/Notifier.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/observer/Notifier.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/observer/Observer.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/observer/Observer.m mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/proxy/Proxy.h mode change 100644 => 100755 src/org/puremvc/objectivec/patterns/proxy/Proxy.m diff --git a/src/org/puremvc/objectivec/core/Controller.h b/src/org/puremvc/objectivec/core/Controller.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/core/Controller.m b/src/org/puremvc/objectivec/core/Controller.m old mode 100644 new mode 100755 index 0495d96..a8e7f72 --- a/src/org/puremvc/objectivec/core/Controller.m +++ b/src/org/puremvc/objectivec/core/Controller.m @@ -86,7 +86,7 @@ -(void)executeCommand:(id)notification { if (commandClassRef == nil) { return; } - [(id)[[[commandClassRef alloc] init] autorelease] execute:notification]; + [(id)[[commandClassRef alloc] init] execute:notification]; } /** @@ -137,9 +137,9 @@ -(void)removeCommand:(NSString *)notificationName { -(void)dealloc { self.commandMap = nil; self.view = nil; - [(id)instance release]; +// [(id)instance release]; instance = nil; - [super dealloc]; +// [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/core/Model.h b/src/org/puremvc/objectivec/core/Model.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/core/Model.m b/src/org/puremvc/objectivec/core/Model.m old mode 100644 new mode 100755 index cb994e9..2ae2e6c --- a/src/org/puremvc/objectivec/core/Model.m +++ b/src/org/puremvc/objectivec/core/Model.m @@ -109,9 +109,9 @@ -(void)registerProxy:(id)proxy { -(void)dealloc { self.proxyMap = nil; - [(id)instance release]; +// [(id)instance release]; instance = nil; - [super dealloc]; +// [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/core/View.h b/src/org/puremvc/objectivec/core/View.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/core/View.m b/src/org/puremvc/objectivec/core/View.m old mode 100644 new mode 100755 index 5e66162..28932a0 --- a/src/org/puremvc/objectivec/core/View.m +++ b/src/org/puremvc/objectivec/core/View.m @@ -199,9 +199,7 @@ -(void)removeObserver:(NSString *)notificationName notifyContext:(id)notifyConte -(void)dealloc { self.mediatorMap = nil; self.observerMap = nil; - [(id)instance release]; instance = nil; - [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/interfaces/ICommand.h b/src/org/puremvc/objectivec/interfaces/ICommand.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IController.h b/src/org/puremvc/objectivec/interfaces/IController.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IFacade.h b/src/org/puremvc/objectivec/interfaces/IFacade.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IMediator.h b/src/org/puremvc/objectivec/interfaces/IMediator.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IModel.h b/src/org/puremvc/objectivec/interfaces/IModel.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/INotification.h b/src/org/puremvc/objectivec/interfaces/INotification.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/INotifier.h b/src/org/puremvc/objectivec/interfaces/INotifier.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IObserver.h b/src/org/puremvc/objectivec/interfaces/IObserver.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IProxy.h b/src/org/puremvc/objectivec/interfaces/IProxy.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/interfaces/IView.h b/src/org/puremvc/objectivec/interfaces/IView.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/command/MacroCommand.h b/src/org/puremvc/objectivec/patterns/command/MacroCommand.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/command/MacroCommand.m b/src/org/puremvc/objectivec/patterns/command/MacroCommand.m old mode 100644 new mode 100755 index d452b79..ec244e4 --- a/src/org/puremvc/objectivec/patterns/command/MacroCommand.m +++ b/src/org/puremvc/objectivec/patterns/command/MacroCommand.m @@ -17,7 +17,7 @@ @implementation MacroCommand * Static Convenience Constructor. */ +(id)command { - return [[[self alloc] init] autorelease]; + return [[self alloc] init]; } /** @@ -89,13 +89,13 @@ -(void)addSubCommand:(Class)commandClassRef { */ -(void)execute:(id)notification { for (Class commandClassRef in subCommands) { - [[[[commandClassRef alloc] init] autorelease] execute:notification]; + [[[commandClassRef alloc] init] execute:notification]; } } -(void)dealloc { self.subCommands = nil; - [super dealloc]; +// [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/patterns/command/SimpleCommand.h b/src/org/puremvc/objectivec/patterns/command/SimpleCommand.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/command/SimpleCommand.m b/src/org/puremvc/objectivec/patterns/command/SimpleCommand.m old mode 100644 new mode 100755 index 4f60843..4cb99c1 --- a/src/org/puremvc/objectivec/patterns/command/SimpleCommand.m +++ b/src/org/puremvc/objectivec/patterns/command/SimpleCommand.m @@ -15,7 +15,7 @@ @implementation SimpleCommand * Static Convenience Constructor. */ +(id)command { - return [[[self alloc] init] autorelease]; + return [[self alloc] init]; } /** diff --git a/src/org/puremvc/objectivec/patterns/facade/Facade.h b/src/org/puremvc/objectivec/patterns/facade/Facade.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/facade/Facade.m b/src/org/puremvc/objectivec/patterns/facade/Facade.m old mode 100644 new mode 100755 index 4bf2362..4810d44 --- a/src/org/puremvc/objectivec/patterns/facade/Facade.m +++ b/src/org/puremvc/objectivec/patterns/facade/Facade.m @@ -296,9 +296,9 @@ -(void)dealloc { self.model = nil; self.controller = nil; self.view = nil; - [(id)instance release]; +// [(id)instance release]; instance = nil; - [super dealloc]; +// [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/patterns/mediator/Mediator.h b/src/org/puremvc/objectivec/patterns/mediator/Mediator.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/mediator/Mediator.m b/src/org/puremvc/objectivec/patterns/mediator/Mediator.m old mode 100644 new mode 100755 index 42af719..c4f6aa1 --- a/src/org/puremvc/objectivec/patterns/mediator/Mediator.m +++ b/src/org/puremvc/objectivec/patterns/mediator/Mediator.m @@ -13,19 +13,19 @@ @implementation Mediator @synthesize mediatorName, viewComponent; +(id)mediator { - return [[[self alloc] initWithMediatorName:nil viewComponent:nil] autorelease]; + return [[self alloc] initWithMediatorName:nil viewComponent:nil]; } +(id)withMediatorName:(NSString *)mediatorName { - return [[[self alloc] initWithMediatorName:mediatorName viewComponent:nil] autorelease]; + return [[self alloc] initWithMediatorName:mediatorName viewComponent:nil]; } +(id)withMediatorName:(NSString *)mediatorName viewComponent:(id)viewComponent { - return [[[self alloc] initWithMediatorName:mediatorName viewComponent:viewComponent] autorelease]; + return [[self alloc] initWithMediatorName:mediatorName viewComponent:viewComponent]; } +(id)withViewComponent:(id)viewComponent { - return [[[self alloc] initWithMediatorName:nil viewComponent:viewComponent] autorelease]; + return [[self alloc] initWithMediatorName:nil viewComponent:viewComponent]; } -(id)initWithMediatorName:(NSString *)_mediatorName viewComponent:(id)_viewComponent { @@ -95,7 +95,6 @@ -(void)onRemove {} -(void)dealloc { self.mediatorName = nil; self.viewComponent = nil; - [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/patterns/observer/Notification.h b/src/org/puremvc/objectivec/patterns/observer/Notification.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/observer/Notification.m b/src/org/puremvc/objectivec/patterns/observer/Notification.m old mode 100644 new mode 100755 index 03de44b..89b6464 --- a/src/org/puremvc/objectivec/patterns/observer/Notification.m +++ b/src/org/puremvc/objectivec/patterns/observer/Notification.m @@ -21,19 +21,19 @@ @implementation Notification * @param type the type of the Notification */ +(id)withName:(NSString *)name body:(id)body type:(NSString *)type { - return [[[self alloc] initWithName:name body:body type:type] autorelease]; + return [[self alloc] initWithName:name body:body type:type]; } +(id)withName:(NSString *)name { - return [[[self alloc] initWithName:name body:nil type:nil] autorelease]; + return [[self alloc] initWithName:name body:nil type:nil]; } +(id)withName:(NSString *)name body:(id)body { - return [[[self alloc] initWithName:name body:body type:nil] autorelease]; + return [[self alloc] initWithName:name body:body type:nil]; } +(id)withName:(NSString *)name type:(NSString *)type { - return [[[self alloc] initWithName:name body:nil type:type] autorelease]; + return [[self alloc] initWithName:name body:nil type:type]; } /** @@ -65,7 +65,6 @@ -(void)dealloc { self.name = nil; self.body = nil; self.type = nil; - [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/patterns/observer/Notifier.h b/src/org/puremvc/objectivec/patterns/observer/Notifier.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/observer/Notifier.m b/src/org/puremvc/objectivec/patterns/observer/Notifier.m old mode 100644 new mode 100755 index 7f4fded..0d824f0 --- a/src/org/puremvc/objectivec/patterns/observer/Notifier.m +++ b/src/org/puremvc/objectivec/patterns/observer/Notifier.m @@ -48,7 +48,7 @@ -(void)sendNotification:(NSString *)notificationName type:(NSString *)type { -(void)dealloc { self.facade = nil; - [super dealloc]; +// [super dealloc]; } @end diff --git a/src/org/puremvc/objectivec/patterns/observer/Observer.h b/src/org/puremvc/objectivec/patterns/observer/Observer.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/observer/Observer.m b/src/org/puremvc/objectivec/patterns/observer/Observer.m old mode 100644 new mode 100755 index c7b1211..a7b66a8 --- a/src/org/puremvc/objectivec/patterns/observer/Observer.m +++ b/src/org/puremvc/objectivec/patterns/observer/Observer.m @@ -17,7 +17,7 @@ @implementation Observer * Static Convienence Constructor. */ +(id)withNotifyMethod:(SEL)notifyMethod notifyContext:(id)notifyContext { - return [[[self alloc] initWithNotifyMethod:notifyMethod notifyContext:notifyContext] autorelease]; + return [[self alloc] initWithNotifyMethod:notifyMethod notifyContext:notifyContext]; } /** @@ -60,7 +60,6 @@ -(void)notifyObserver:(id)notification { -(void)dealloc { self.notifyMethod = nil; self.notifyContext = nil; - [super dealloc]; } diff --git a/src/org/puremvc/objectivec/patterns/proxy/Proxy.h b/src/org/puremvc/objectivec/patterns/proxy/Proxy.h old mode 100644 new mode 100755 diff --git a/src/org/puremvc/objectivec/patterns/proxy/Proxy.m b/src/org/puremvc/objectivec/patterns/proxy/Proxy.m old mode 100644 new mode 100755 index 4bdaca7..ca6706c --- a/src/org/puremvc/objectivec/patterns/proxy/Proxy.m +++ b/src/org/puremvc/objectivec/patterns/proxy/Proxy.m @@ -13,19 +13,19 @@ @implementation Proxy @synthesize data, proxyName; +(id)proxy { - return [[[self alloc] initWithProxyName:nil data:nil] autorelease]; + return [[self alloc] initWithProxyName:nil data:nil]; } +(id)withProxyName:(NSString *)proxyName { - return [[[self alloc] initWithProxyName:proxyName data:nil] autorelease]; + return [[self alloc] initWithProxyName:proxyName data:nil]; } +(id)withProxyName:(NSString *)proxyName data:(id)data { - return [[[self alloc] initWithProxyName:proxyName data:data] autorelease]; + return [[self alloc] initWithProxyName:proxyName data:data]; } +(id)withData:(id)data { - return [[[self alloc] initWithProxyName:nil data:data] autorelease]; + return [[self alloc] initWithProxyName:nil data:data]; } -(id)initWithProxyName:(NSString *)_proxyName data:(id)_data { @@ -67,7 +67,6 @@ -(void)onRemove {} -(void)dealloc { self.data = nil; self.proxyName = nil; - [super dealloc]; } @end