![]() To edit the value for a specify key, double-click the value in the Xcode property list editor to select it, then type a new value. To display the actual key names as they appear in the ist file, Control-click any of the keys in the editor window and enable the Show Raw Keys/Values item in the contextual menu. Note: The property list editor in Xcode displays human-readable strings (instead of the actual key name) for many keys by default. Double-click the ist filename in Finder which will automatically open the Xcode property list editor. To edit the contents of your ist file, you can use any text editor that uses UTF-8 though it may be safer to use Xcode which understands the XML formatting of information property list files. CFBundleDevelopmentRegion English CFBundleExecutable MyApp CFBundleName MyApp CFBundleIdentifier CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleSignature MyAp CFBundleShortVersionString 0.1 CFBundleVersion 1 CSResourcesFileMapped CFBundleDocumentTypes CFBundleTypeRole Viewer CFBundleTypeExtensions * CFBundleTypeOSTypes fold disk **** NSHighResolutionCapable Editing an ist Here's an example of an ist created by Lazarus for a simple macOS application: The file created by Lazarus comes preconfigured with basic key value pairs that every information property list should have. When you use the Lazarus Project > Project Options, and click the Create application bundle option, Lazarus creates a default application bundle and an ist file which you can find in the project_name.app/Contents subdirectory. The simplest way to create an information property list file for as macOS application is to let Lazarus create it for you. The way an application provides its metadata to the system is through the use of a special file called an information property list file which is named ist. Some of the metadata is used by the system frameworks to facilitate the launch of applications. Some of it is displayed to the user, some of it is used internally by the system to identify your application location, the icon to display, the document types it supports and many other behaviours that have an impact outside the bundle itself. This metadata is used in many different ways. $ plutil -convert json // convert to JSON formatĮvery macOS and iOS application relies on the presence of special metadata in each application or bundle. $ plutil -convert xml1 // convert to XML format $ plutil -convert binary1 // convert to binary format : ASCII text, with no line terminators // JSON formatĬonverting between the different plist formats can be performed using the plutil command line utility on macOS: : XML 1.0 document text, ASCII text // XML format : Apple binary property list // binary format The property list file type can be identified using the file command on macOS: ![]() Although property lists can include NSData objects, it’s best to not use data objects in property lists to hold large amounts of binary data. And you cannot use property lists to store objects that are not supported by the architecture, such as model objects. ![]() You should not use property lists to store large, complex graphs of objects, especially when the objects have variable mutability settings. Property list files have the filename extension of plist. You can also edit a JSON file because it is just concatenated text and much less verbose than pure XML. However, you can manually edit an XML property list if you ever need to. The binary format is much more compact than the XML version and thus more efficient. You can write property lists out in XML, JSON and binary formats. The abstract data types have corresponding Foundation classes, Core Foundation types, and XML elements for collection objects and value objects. This hierarchical nesting of objects creates a graph of objects. Dictionaries and arrays are special types because they are collections they can contain one or multiple data types, including other dictionaries and arrays. Property lists consist only of certain types of data: dictionaries, arrays, strings, numbers (integer and float), dates, binary data, and Boolean values. Both Cocoa Foundation and Core Foundation have APIs related to property list serialization and deserialization. Applications can later read the static representation back into memory and recreate the original hierarchy of objects. Property lists are easy to create programmatically and are even easier to serialize into a representation that is persistent. They are hierarchies of data made from specific types of objects-they are, in effect, an object graph. ![]() Property lists give applications a lightweight and portable way to store small amounts of data. A property list is a representation of a hierarchy of objects that can be stored in the file system and reconstituted later. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |