Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

j2objc - resolving object types

I've installed j2objc and am trying to convert my package to objective-c. My classes reference each other and also JSONObject and JSONArray. I'm getting a a bunch of the following errors

classname cannot be resolved to a type

How do i make sure these references resolve?

like image 359
David Avatar asked Apr 08 '13 16:04

David


1 Answers

If you don't have j2objc defined as a system variable, here's what I did:

  1. Place j2objc folder inside your java project folder (to simplify paths in terminal)
  2. If your Java project package names are something like com.example.appName.ClassName.java -j2objc folder should be in same directory as com
  3. In terminal, cd to ProjectName containing com
  4. Place this in command line:

    j2objc-0.8.3/j2objc -use-arc -sourcepath com --ignore-missing-imports com/example/appName/*

The key you are probably missing is -sourcepath. use-arc and ignore-missing-imports are optional.

like image 117
jwilkey Avatar answered Sep 29 '22 06:09

jwilkey