--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/ecd10904-b57d-4218-b35e-10a7d3817379n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/76af21fa-4b23-4dea-b0bb-e7b887755c16n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/3c515d20-fe2a-41a3-b7a3-99fde7fdcb11n%40googlegroups.com.
- (ASWRequest *)replaceTagsWithASWv2ImageTagArray:(IOSObjectArray<ASWv2ImageTag *> *)tags
I haven't had a chance yet to do a standalone test with Swift, as i'll need a fresh project set up - our existing project has a million errors related to non-generically-typed access to IOSObjectArray currently with the new j2objc build :)
I did a quick translation test of a simple java class Monkey.java with array arguments, and again observed that the type information is not passed along, as above, eg:
public Monkey(String[] sounds)
becomes
- (instancetype)initWithNSStringArray:(IOSObjectArray *)sounds
rather than
- (instancetype)initWithNSStringArray:(IOSObjectArray<String *> *)sounds
Note the method name is interesting - how does it know that it should be an NSStringArray? Hmm...
While I did have more success with:
void sort(int[] numbers)
becoming:
- (void)sortWithIntArray:(IOSIntArray *)numbers
Where IOSIntArray obviously is generically typed, which is great.
Thanks for any wisdom you can impart...
array: IOSObjectArray<ASWv2Attachment>?
I tried to assign it as a Swift typed array:
let attachments2: [ASWv2Attachment] = array!
But the compiler errored with: "'IOSObjectArray<ASWv2Attachment>' is not convertible to '[ASWv2Attachment]'"
This surprised me a little as IOSObjectArray<T> is an IOSArray<T> which is now an NSArray<T> - I think?
Thanks again in advance for any wisdom you can impart... :)
let attachments2: [ASWv2Attachment] = array as! [ASWv2Attachment]
The compiler was happier with this, but i'm not sure if thats just bending the pointers to my will... :)
To view this discussion on the web visit https://groups.google.com/d/msgid/j2objc-discuss/249bd876-62c2-4797-97b6-a5db87b509a6n%40googlegroups.com.