SRHubservable Class Reference
Inherits from | NSObject |
Declared in | SRHubservable.h |
Tasks
Properties
-
eventName
An
propertyNSString
object representing the name of the subscription event -
proxy
An
propertySRHubProxy
object representing the Hub to be observed
Initializing an SRHubservable Object
-
+ observe:event:
A convenience method for initWithProxy:(SRHubProxy )proxy eventName:(NSString )eventName;
-
– initWithProxy:eventName:
Initializes a new
SRHubservable
object
Adding Subscriptions
-
– subscribe:selector:
Adds a new Subscription to the underlying proxy for eventName
Properties
eventName
An NSString
object representing the name of the subscription event
@property (strong, nonatomic, readonly) NSString *eventName
Declared In
SRHubservable.h
proxy
An SRHubProxy
object representing the Hub to be observed
@property (strong, nonatomic, readonly) SRHubProxy *proxy
Declared In
SRHubservable.h
Class Methods
observe:event:
A convenience method for initWithProxy:(SRHubProxy )proxy eventName:(NSString )eventName;
+ (id)observe:(SRHubProxy *)proxy event:(NSString *)eventName
Parameters
- proxy
the
SRHubProxy
object representing the Hub to be observed
- eventName
the
NSString
object representing the name of the subscription event
Return Value
an SRHubservable
object
Discussion
SRHubservable *observable = [SRHubservable observe:myHub event:@“myEvent”];
Declared In
SRHubservable.h
Instance Methods
initWithProxy:eventName:
Initializes a new SRHubservable
object
- (id)initWithProxy:(SRHubProxy *)proxy eventName:(NSString *)eventName
Parameters
- proxy
the
SRHubProxy
object representing the Hub to be observed
- eventName
the
NSString
object representing the name of the subscription event
Return Value
an SRHubservable
object
Discussion
SRHubservable *observable = [SRHubservable observe:myHub event:@“myEvent”];
Declared In
SRHubservable.h
subscribe:selector:
- (SRSubscription *)subscribe:(NSObject *)object selector:(SEL)selector
Parameters
- object
The receiver to perform selector on
- selector
A selector identifying the message to send.
Return Value
the SRSubscription
object created
Declared In
SRHubservable.h