如何使用objective-c从Excel文档读取单元格数据 [英] How to read cell data from an Excel document with objective-c

查看:302
本文介绍了如何使用objective-c从Excel文档读取单元格数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个iPhone应用程序,必须从网站下载Excel(.xls)文件,并对电子表格数据执行字符串搜索。我在C#中做到了这一点,但是我不知道如何在Objective-C中执行此操作。如何使用objective-c访问单个单元格?

I'm building an iPhone app that has to download an Excel (.xls) file from a website and perform a string search of the spreadsheet data. I've done this in C#, but I have no idea how to do this in objective-c. How do I access the individual cells using objective-c?

推荐答案

没有固有的能力将Excel数据读入Foundation容器,像一个 NSArray NSDictionary 。然而,您可以将文件(使用Excel)转换为逗号分隔值(CSV)文件,然后使用 NSString 实例方法在iPhone上解析每行的单元格 -componentsSeparatedByString:

There is no innate ability to read Excel data into a Foundation container, like an NSArray or NSDictionary. You could, however, convert the file (with Excel) to a comma-separated-value (CSV) file and then parse each line's cells on the iPhone using the NSString instance method -componentsSeparatedByString:.

这篇关于如何使用objective-c从Excel文档读取单元格数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆