【问题标题】:Cannot convert to a pointer type无法转换为指针类型
【发布时间】:2010-08-19 13:18:06
【问题描述】:

我正在尝试使用 ASP.net Web 服务,并找到了一个名为 WSDL2ObjC 的实用程序。 现在我正在尝试使用它,并且基本使用正在工作(要求简单的数据类型,例如布尔值或字符串),但现在我正在请求“EmailServiceSvc_Email”结构的数组,其中包含“主题”,“ from”和“message”属性。

应用程序无法编译,上面的消息显示,这是卡住的代码:

EmailServiceSvc_Email * eml = (EmailServiceSvc_Email *) arrEmails[[indexPath row]];

这是变量的解释:

  • eml : 我试图从 arrEmails 中取出的新变量。
  • arrEmails:EmailServiceSvc_Email 对象的 NSMutableArray
  • indexPath:indexPath参数,来自cellForRowAtIndexPath函数。

如您所见,我想在 iPhone 上的 TableView 中显示“EmailServiceSvc_Email”结构中的所有“主题”。

【问题讨论】:

    标签: iphone objective-c pointers


    【解决方案1】:

    要从 NSMutableArray 中获取元素,您必须使用 -objectAtIndex:a[i] 语法不适用于 NSArrays。

    EmailServiceSvc_Email* eml = [arrEmails objectAtIndex:indexPath.row];
    

    【讨论】:

      【解决方案2】:

      我写了一篇关于 Wsdl2objc 和复杂类型的教程:

      http://brismith66.blogspot.com/2010/07/iphone-development-accessing-soap.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-20
        • 1970-01-01
        • 2020-08-22
        • 2011-12-29
        • 2016-07-26
        • 2021-11-14
        • 1970-01-01
        相关资源
        最近更新 更多