MGLOfflineStorage implements a singleton (shared object) that manages offline
packs. All of this class’s instance methods are asynchronous, reflecting the
fact that offline resources are stored in a database. The shared object
maintains a canonical collection of offline packs in its packs property.

Declaration

An offline storage object sends messages to its delegate to allow it to
transform URLs before they are requested from the internet. This can be used
add or remove custom parameters, or reroute certain requests to other servers
or endpoints.

Declaration

An array of all known offline packs, in the order in which they were created.

This property is set to nil, indicating that the receiver does not yet know
the existing packs, for an undefined amount of time starting from the moment
the shared offline storage object is initialized until the packs are fetched
from the database. After that point, this property is always non-nil, but it
may be empty to indicate that no packs are present.

To detect when the shared offline storage object has finished loading its
packs property, observe KVO change notifications on the packs key path.
The initial load results in an NSKeyValueChangeSetting change.

To detect when any call to this method results in a new pack, observe KVO
change notifications on the shared offline storage object’s packs key path.
Additions to that array result in an NSKeyValueChangeInsertion change.

Unregisters the given offline pack and allows resources that are no longer
required by any remaining packs to be potentially freed.

As soon as this method is called on a pack, the pack becomes invalid; any
attempt to send it a message will result in an exception being thrown. If an
error occurs and the pack cannot be removed, do not attempt to reuse the pack
object. Instead, if you need continued access to the pack, suspend all packs
and use the -reloadPacks method to obtain valid pointers to all the packs.

To detect when any call to this method results in a pack being removed, observe
KVO change notifications on the shared offline storage object’s packs key
path. Removals from that array result in an NSKeyValueChangeRemoval change.

When you remove an offline pack, any resources that are required by that pack,
but not other packs, become eligible for deletion from offline storage. Because
the backing store used for offline storage is also used as a general purpose
cache for map resources, such resources may not be immediately removed if the
implementation determines that they remain useful for general performance of
the map.

Parameters

Forcibly, asynchronously reloads the packs property. At some point after this
method is called, the pointer values of the MGLOfflinePack objects in the
packs property change, even if the underlying data for these packs has not
changed. If this method is called while a pack is actively downloading, the
behavior is undefined.

You typically do not need to call this method.

To detect when the shared offline storage object has finished reloading its
packs property, observe KVO change notifications on the packs key path.
A reload results in an NSKeyValueChangeSetting change.