omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    ObjC parse_type error

    Pythonista
    2
    3
    2046
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Cethric
      Cethric last edited by

      @omz I will look into this further but in Pythonista3 Parse Exceptions are raised with certain classes and functions on their generated encodings.
      An example is listed as follows:
      NSObject -> CA_copyRenderValue: b'^{Object=^^?{Atomic={?=i}}}16@0:8'
      In the format CLASS -> FUNCTION: encoding
      The except is as follows
      ParseException: expected '}' (at char 8) (line: 1, col: 9)
      I will post the relevant code in a GitHub repository once I am somewhere with decent internet.

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        The type encoding parser has difficulty on complicated structures (or, I think pointers to structures are not handled well). You can use restype and argtypes kwargs to override the encoding parser (don't include the implicit self and selector args).

        In the above example, the key is that it is a pointer to a structure. You could create a ctypes structure, though this is a fairly complicated struct... you could just use an opaque pointer... argtypes=[], restype=[c_void_p]

        1 Reply Last reply Reply Quote 0
        • Cethric
          Cethric last edited by

          @JonB thank you for the reply, I will look into implimenting a fix soon.
          I have been trying to extend the Header Parser that I used for OpenGLES to include most of the iOS headers.
          So far it seems to work well...

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors