开发者

Cannot convert to a pointer type

开发者 https://www.devze.com 2023-01-12 01:13 出处:网络
I\'m trying to consume an ASP.net Web service, and foun开发者_运维问答d a utility called WSDL2ObjC.

I'm trying to consume an ASP.net Web service, and foun开发者_运维问答d a utility called WSDL2ObjC. Now I'm trying to use it, and basic use is working (asking for simple data types, such as booleans or strings), but now I'm requesting an array of the "EmailServiceSvc_Email" structure, which contains "subject", "from" and "message" properties.

The app won't compile, with the message above, and here's the code on wich it gets stuck:

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

This is the explanation of the variables:

  • eml : the new variable I'm trying to get out of arrEmails.
  • arrEmails: an NSMutableArray of the EmailServiceSvc_Email object
  • indexPath: the indexPath parameter, this is from the cellForRowAtIndexPath function.

As you can see probably, I want to display all the "subject"s from the "EmailServiceSvc_Email" structure in a TableView, on the iPhone.


To get an element out of an NSMutableArray you must use -objectAtIndex:. The a[i] syntax does not work with NSArrays.

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


I wrote a tutorial about Wsdl2objc and complex types:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消