MBInstanceVendor Protocol Reference

Conforms to NSObject
Declared in MBSingleton.h

Overview

Adopted by classes that provide instance accessors but that don’t necessarily abide by singleton behavior.

Singletons will only ever return a single object pointer over the running lifetime of an application. Such classes should adopt the MBSingleton protocol.

Implementations that may return different object pointers over the lifetime of an application should adopt the MBInstanceVendor protocol.

If a class explicitly adopts MBInstanceVendor instead of MBSingleton, it serves as a signal that callers should not hold long-term references to the return value of the instance method.

+ instance required method

Retreives the object instance currently vended by the receiver.

+ (instancetype)instance

Return Value

The current instance. Callers should not assume that the return value will be the same every time this method is invoked.

Declared In

MBSingleton.h