我正在做一个iOS游戏,它将从数据库中的线索库中挑选一个随机线索(文本)和图像(线索和图像进来一组,1行)。我有一个webMethods和函数,允许我拉出数据库行的Web服务。 (线索测试)我一直在Google上搜索关于如何从db中将图像导入iOS的文章,但无济于事。webservice与图像文件
如何通过Web服务从数据库导入图像(使用C#构建)?任何人都可以请指导我在正确的方向吗?我希望它被存储在mutableArray中,这样在播放器完成播放后,线索和图像将从临时数组中清除。 (我不想将图像放在应用程序中,因为这样会使应用程序非常大,并且用户可以上传自己的线索和图像,因此从数据库实时馈送是理想的方法。我正在使用List来存储线索,但不知道要用什么来存储图像,我想用ArrayList来存储对象,但是有不知道如何将其转换为iOS端的图像,正如我上面提到的,我似乎无法找到任何教程或示例通过web服务将图像导入iOS应用程序(或者我使用了错误的搜索术语)
如果有任何帮助我可以帮助我,或提供替代解决方案,使图像和线索的实时更新将有所帮助。
编辑 - 我发现ImageList()和列表。我现在应该使用哪一个? 也发现图像文件只是 - > image testfile;
EDIT2 - problem I'm facing
-dealing with image file (image? imagelist?
-when drawing datarow from DB in webservice, how do i deal with the image file. (guessing ImageList or List<image> (after some luck on research)
-assuming 2nd point works fine, i should be able to solve the client side
(sorry, noobie at webservice,)
。
what I have
-webservice that draw datarow from database for clue(string) (tested and working fine with my function)
-iOS client side with RESTful architecture
。
what I need
-webservice that draw datarow from database for picture(image (format not so important yet)) (code should be similar to drawing clue, only which function to store it in. (using List<string> for clues)
首先你应该使用WCF而不使用ASMX网络服务。这是一项不应该用于新开发的传统技术。 – 2012-08-10 03:54:36
对于我来说,还有点不清楚实际上你有问题的部分。 List和ImageList - 你想在客户端使用它们吗?我想?你还提到你在导入图像时遇到问题(服务器端)。我认为有些东西在这里混合。您能否重新解释这个问题并提供更多信息?如果你能够确切地指出你有什么以及是什么导致了你的问题(点数),那也是有帮助的。这将使答案更容易。 – MaciekTalaska 2012-08-10 16:55:50
列表和ImageList()是c#函数。但我不知道我应该使用哪一个。类似列表和ArrayList其中ArrayList已过时。 –
2012-08-11 03:49:36