IOSByteArray.h not found

248 views
Skip to first unread message

Alan M

unread,
Sep 13, 2014, 7:27:20 PM9/13/14
to j2objc-...@googlegroups.com
I'm seeing an error in the last line below:

#include "IOSClass.h"
#include "IOSPrimitiveArray.h"
#include "IOSByteArray.h"

What should I include to use IOSByteArray? I need it because I have to convert it to an NSData in order to encode/decode it for NSCoding. Any help/suggestions appreciated.

PS I hope this question is not super dumb, because it's my first to this group.

thanks
Alan

Tom Ball

unread,
Sep 14, 2014, 10:57:38 AM9/14/14
to j2objc-...@googlegroups.com
The only super dump thing to do is assume the project doesn't work and delete it. :-)

All the header files are in the distribution's include/ directory. If you downloaded and unzipped the distribution bundle, that directory will be in j2objc-0.9.6/include/. If you built from project source, it will be in dist/include. If you are working with Xcode, add that path to each target's Header Search Paths, as described here.

That said, you may not need to write any conversion code. All array classes (IOS*Array) implement the NSCopying protocol. For NSData instances, there's also NSDataInputStream and NSDataOutputStream classes for java.io use. Finally, IOSByteArray has "- (NSData *)toNSData" for bytes to NSData directly, while creating arrays from NSData use its "- (instancetype)arrayWithBytes:(const char *)bytes count:(NSUInteger)count" constructor.

Tom

--
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.
For more options, visit https://groups.google.com/d/optout.

Alan M

unread,
Sep 14, 2014, 6:24:01 PM9/14/14
to j2objc-...@googlegroups.com
Thanks Tom. Actually my problem was that the appropriate header is IOSPrimitiveArray.h which contains the interface for IOSByteArray. As my question indicated, I was already including it for other reasons. But XCode was indicating an error which I mis-interpreted as a missing header. Ah well.
Reply all
Reply to author
Forward
0 new messages