Dictionary--plist

Source: Internet
Author: User

Use plist to put the dictionary array into the plist file, you can not change the code, you need to delete the data directly modify the Plist file-(nsarray*) imagedata{
if (_imagedata = = nil) {//Never initialized
Initializing data
Nsmutabledictionary *image1 = [Nsmutabledictionary dictionary];
Image1[mjiconkey] = @ "Biaoqingdi";
Image1[mjdesckey] = @ "In front of him, other god horse expression is weak!" ";

Nsmutabledictionary *image2 = [Nsmutabledictionary dictionary];
Image2[mjiconkey] = @ "Wangba";
Image2[mjdesckey] = @ "Brother Why choose Eighth";

Nsmutabledictionary *image3 = [Nsmutabledictionary dictionary];
Image3[mjiconkey] = @ "Bingli";
Image3[mjdesckey] = @ "This is also cruel";

Nsmutabledictionary *image4 = [Nsmutabledictionary dictionary];
Image4[mjiconkey] = @ "Chiniupa";
Image4[mjdesckey] = @ "Chiniupa";

Nsmutabledictionary *image5 = [Nsmutabledictionary dictionary];
Image5[mjiconkey] = @ "Danteng";
Image5[mjdesckey] = @ "Pro, can you change your screen name?" Haha ";

Nsmutabledictionary *image6 = [Nsmutabledictionary dictionary];
Image6[mjiconkey] = @ "Chiniupa";
Image6[mjdesckey] = @ "New data haha haha haha";

_imagedata = @[image1, Image2, Image3, Image4, Image5];
}
return _imagedata;} plist file Call-(nsarray*) imagedata{
if (_imagedata = = nil) {//Never initialized
Initializing data
File: Full path//NSBundle: A nsbundle represents a folder 1.NSBundle
1> a nsbundle represents a folder, with NSBundle access to the corresponding folder
2> can access any resource in the software resource bundle using Mainbundle
Installation path of the 3> emulator application/users/aplle/repository/application support/iphone simulator/7.1/applications//access to software resource bundles with Mainbundle Any of the resources in
NSBundle *bundle = [NSBundle mainbundle];

Get the full path of imagedata.plist
NSString *path = [Bundle pathforresource:@ "ImageData" oftype:@ "plist"];

_imagedata = [Nsarray Arraywithcontentsoffile:path];
}
return _imagedata;}

Dictionary--plist

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.