Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
May 27, 2017, 10:29:43 AM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.
Pages: [1]
Print
Author Topic: Using multiple instances of the same Mediator  (Read 5725 times)
saad
Sr. Member
****
Posts: 65


View Profile
« on: December 28, 2010, 05:57:10 AM »

http://blog.loadvars.com/2009/07/07/using-multiple-instances-of-the-same-mediator-in-puremvc/

In view of the above post, how to accomplish the same for Objective-C Port?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2866



View Profile WWW
« Reply #1 on: December 29, 2010, 09:12:49 AM »

The mediator just has to have a unique name. In the demo you linked to, that name is a concatenation of the view component's id property and the mediator's NAME constant. Does your view component not have the equivalent of an id property?

-=Cliff>
Logged
saad
Sr. Member
****
Posts: 65


View Profile
« Reply #2 on: January 10, 2011, 04:43:59 AM »

Hi:

I worked it out using following strategy,

@implementation CigaretteMediator

+ (NSString *)NAME {
    return @"CigaretteMediator";
}

- (void)initializeMediator {
    self.mediatorName = [[CigaretteMediator NAME] stringByAppendingString:[viewComponent name]];
}

in my view component had to create a function and property ([viewComponent name]), for setting and retrieving a unique name, though I was looking for a built-in property such as what Cliff suggest like id something, is there something like that we can set and get a built-in property programmatically for each UIViewController
« Last Edit: January 10, 2011, 04:45:43 AM by saad » Logged
Pages: [1]
Print
Jump to: