MBMLResourceFunctions Class Reference
Inherits from | NSObject |
---|---|
Declared in | MBMLResourceFunctions.h |
Overview
This class implements MBML functions for obtaining information about
NSBundle
resources.
These functions are exposed to the Mockingbird environment via
<Function ... />
declarations in the MBDataEnvironmentModule.xml
file.
For more information on MBML functions, see the MBMLFunction
class.
+ directoryForMainBundle
Determines the directory containing the resources for the main NSBundle
.
+ (id)directoryForMainBundle
Return Value
The directory containing the main bundle’s resource files, or
nil
if it couldn’t be found.
Discussion
This Mockingbird function accepts no parameters.
Expression usage
^directoryForMainBundle()
The expression above would return the filesystem path of the resource
directory for the main NSBundle
.
Declared In
MBMLResourceFunctions.h
+ directoryForBundleWithIdentifier:
Determines the directory containing the resources for the NSBundle
with the
specified bundle identifier.
+ (id)directoryForBundleWithIdentifier:(NSString *)bundleID
Parameters
bundleID |
The bundle identifier. |
---|
Return Value
The directory containing the resources for the NSBundle
with the
identifier bundleID
, or nil
if it couldn’t be found.
Discussion
This Mockingbird function accepts a single expression as a parameter, yielding the bundle identifier.
Expression usage
^directoryForBundleWithIdentifier(com.gilt.ios)
The expression above would return the filesystem path of the resource
directory for the NSBundle
with the identifier com.gilt.ios
if it exists.
If no such bundle exists, nil
is returned.
Declared In
MBMLResourceFunctions.h
+ directoryForClassBundle:
Determines the directory containing the resources for the NSBundle
associated
with the specified class.
+ (id)directoryForClassBundle:(NSString *)className
Parameters
className |
The class name. |
---|
Return Value
The directory containing the resources for the NSBundle
associated
with the class className
, or nil
if it couldn’t be found.
Discussion
This Mockingbird function accepts a single expression as a parameter, yielding the class name.
Expression usage
^directoryForClassBundle(MBEnvironment)
The expression above would return the filesystem path of the resource
directory for the NSBundle
associated with the MBEnvironment
class.
Declared In
MBMLResourceFunctions.h