Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何使用plist从服务器加载图像_Ios_Uiimageview_Plist - Fatal编程技术网

Ios 如何使用plist从服务器加载图像

Ios 如何使用plist从服务器加载图像,ios,uiimageview,plist,Ios,Uiimageview,Plist,我在应用程序中使用plist获取数据,但我不希望数据存储在本地(大量图像),我希望图像上传到服务器上,并能够从那里读取。可以使用plist吗 以下是项目的plist结构: <key></key> <string> Servings: 4 Preheat oven to 350˚F. Grease a 1 to 2-quart baking dish. In a medium bowl, toss together the bread cubes

我在应用程序中使用plist获取数据,但我不希望数据存储在本地(大量图像),我希望图像上传到服务器上,并能够从那里读取。可以使用plist吗

以下是项目的plist结构:

<key></key>
        <string> Servings: 4
Preheat oven to 350˚F. Grease a 1 to 2-quart baking dish.
In a medium bowl, toss together the bread cubes and butter.
In a large bowl, toss together the apples, agave syrup, lemon juice, cinnamon, allspice, and salt.
Cover and bake 30 minutes. Uncover and bake 20 to 30 minutes longer or until bread cubes are browned.
</string>
        <key>smallImage</key>
        <string>s130.png</string>
        <key>ingredients</key>
        <string>2 cups cubed sourdough bread (½-inch cubes) 
        1 tablespoon melted butter 
        3 cups thinly sliced, peeled apples 
        ¼ cup agave syrup 
        2 teaspoons fresh lemon juice 
        ½ teaspoon ground cinnamon 
        ¼ teaspoon ground allspice 
        Salt to taste
</string>
        <key>title</key>
        <string>Apple Brown Betty
</string>
        <key>coverImage</key>
        <string>130.png</string>
    </dict>

要从服务器加载图像,可以使用SDWEBIMAGE。下载并复制到您的项目中。 现在你需要

#import <SDWebImage/UIImageView+WebCache.h>
其中,当服务器上的图像不可用时,占位符图像是默认图像。
希望这对你有帮助

为什么你特别想通过Plist来实现它?我是一个初学者,没有使用过其他任何东西,如果不可能,我可能会寻找另一种方式来加载数据,我会把答案贴在上面,告诉你如何使用它。解释你的需要,并发送一些代码说明你是如何尝试的@我想看看我的答案。希望它能帮助你了解something@B3RRi3d,如果这对你有帮助,那就养成投票的习惯:)
#import <SDWebImage/UIImageView+WebCache.h>
[YourImageView setImageWithURL:[NSURL URLWithString:@"Your URL link"]
                   placeholderImage:[UIImage imageNamed:@"placeholder.png"]];