# Issue in iOS after cross compile using XmlPull library

**URL:** <https://techcommunity.softwareag.com/t/issue-in-ios-after-cross-compile-using-xmlpull-library/102301>\
**Category:** Forum\
**Tags:** mobile\
**Created:** [January 11, 2013, 2:16am UTC](https://techcommunity.softwareag.com/t/issue-in-ios-after-cross-compile-using-xmlpull-library/102301 "2013-01-11T02:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 11, 2013, 2:16am UTC](https://techcommunity.softwareag.com/t/issue-in-ios-after-cross-compile-using-xmlpull-library/102301/1 "2013-01-11T02:16:35Z")

</div>

Greetings,

We’re working on an app, and the developer is including the xmlpull library to work with some XML data.

In XCode, the XmlPullParserFactory.mm class shows a pair of Semantic issues with a specific line.

In the original java it looks like this:

final String name = classNames.substring(pos, cut);

Class candidate = null;

Object instance = null;

try

{

```
  candidate = Class.forName(name);

  // necessary because of J2ME .class issue

  instance = candidate.newInstance();

```

}

When converted to Objective C, the first line in the try block looks like:

candidate = Class::forName(name);

… and I get the following 2 issues with that line:

- 

```
  Expected a class or namespace

```

- 

```
  Reference to ‘Class’ is ambiguous

```

I’ve done no native iOS development, so I don’t know where to start on this. Has anyone seen anything like this before, or have any insight they can share?

Dave

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 11, 2013, 2:28pm UTC](https://techcommunity.softwareag.com/t/issue-in-ios-after-cross-compile-using-xmlpull-library/102301/2 "2013-01-11T14:28:13Z")

</div>

Ambiguity sometimes happens where ObjectiveC names clash with Java ones.

I would modify the java to have an import at the top of:

import java.lang.Class;

and then change any references to Class to be fully qualified e.g.

java.lang.Class candidate = null;

…

```
        candidate = java.lang.Class.forName(name);

```

etc…

That way the compiler will not have a chance to get confused.

Cheers,

Matt

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/issue-in-ios-after-cross-compile-using-xmlpull-library/102301/3 "2021-04-02T15:02:51Z")

</div>


