Error when I bind an Objective-C Package - ios

I want to bind an Objective-C Package in my Xamarin project. I follow the step from
here.
However,the content seems incomplete.And I want to know what to do next.Any advice will help me.

Have you get two file(xxx_ApiDefinitions.cs and xxx_StructsAndEnums.cs )? Copy the code from two files to binding project.
That's not enough. The compiler will prompt a large number of errors . Such as
You have to do something. For example, use the ulong/long instead of nuint ,and annotate the code such as [Verify(MethodToProperty)] .In addition,there are some differences between iOS and Xamarin.iOS in name of Object.For example ,NSURL in OC and NSUrl in C#.You need to manually modify it.

Related

How to include libsignal-protocol-c in my Swift iOS app?

I would like to write something like import SignalProtocol at the top of one of my Swift files and then be able to call the C functions from libsignal-protocol-c.
libsignal-protocol-c's README says: "When integrating into actual applications, you should not need anything beyond CMake. Alternatively, you may integrate the code using a build system of your choice."
I think I'd like to use the Swift Package Manager to integrate libsignal-protocol-c into my Swift iOS app. Is there a way to automatically generate a manifest file, ie, Package.swift, and a module map, ie, a module.modulemap file, from libsignal-protocol-c's CMake files? Or if I need to create these files manually, what should they include? Otherwise, how would I do this with CMake?
How to import and use libsignal-protocol-c in an existing .xcodeProj? is a similar question but for Objective-C projects.
I'm not sure its an answer but I'm going to start using https://github.com/christophhagen/LibSignalProtocolSwift. Seems like a good start.

Importing CocoaPod into Swift Playground Produces Expression Failed to Parse Error

I have several private pods that I'm already using successfully in my project. I added a Swift playground to the workspace (not to the project), and I've added an import Foo statement to the top of the playground.
Autocomplete is working for my pod modules, so things seem to be set up correctly. However, I'm getting this very obscure error:
expression failed to parse, fixed expression suggested:
#sourceLocation(file: "Foo.playground", line: 1)
It doesn't matter which line I put my import statement on; it always refers to line 1.
There is notably some Obj-C code in the framework that’s being imported. I’m not sure if that matters or not since it’s callable from the Swift in my app.
Any help would be appreciated!
Update (7/21/19): Still haven't been able to resolve this, but I was able to confirm that a much simpler Obj-C library is callable from a playground. So, it's just the complex one I was trying to call initially. Since this is proprietary, there's not a lot of info I can share, but if anyone has suggestions on what to try (or what I can genericize, extract, and share here), I'm happy to take a stab at it and update you. Thanks!

How to wrap existing iOS code in a new Appcelerator module?

This seems like a basic request, but I can't find the answer to it anywhere. I want to wrap some existing iOS code that I wrote, in a Appcelerator module. That's it. Important points:
I am NOT wrapping a pre-existing 3rd party iOS SDK.
I wrote the iOS code being wrapped.
Code is verified as working within xcode.
There are no .a files. There are 2x .h files and 2x .m files though.
There are no UI elements in the iOS code as it is only designed to connect the native bluetooth hardware to the app.
I have created a generic appcelerator iOS module project, built it, and successfully called the generic ID function within my app.
I cannot figure out how to successfully edit the generic module so that it utilizes my code. Every attempt results in it refusing to compile, and it's maddening.
I do not have access to Hyperloop.
Once I can successfully build the wrapped module, I would call an initialization function which triggers a native bluetooth hardware search. Once connected, there are functions within the module to send commands to the hardware and receive data back. This is the official documentation I've followed so far:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Quick_Start
That helped me build the blank module, include it in the app, and ensure that it worked by calling the built in test property. From there it stops short of actually telling me what I need to know. These are the closest things I've found so far, while still not being what I need:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Project-section-43288810_iOSModuleProject-AddaThird-PartyFramework
appcelerator module for existing ios project sdk
Heck, I still don't even know if I can do this within studio or if I have to edit the generic module in Xcode. Help! :) Many thanks in advance.
so first of all, this is not best practice and will cause possible problems in the future when the SDK changes and your module still relies on outdated core API's.
Regarding your question, you could either create a new component that subclasses the existing class, e.g.
class TiMyModuleListViewProxy : TiUiListViewProxy {
}
and call it with
var myList = MyModule.createListView();
or you write a category to extend the existing API with your own logic, e.g.
#interface TiUIListViewProxy (MyListView)
- (void)setSomethingElse:(id)value;
#end
#implementation TiUIListViewProxy (MyListView)
- (void)setSomethingElse:(id)value
{
// Set the value of "somethingElse" now
}
#end
I would prefer the second option since it matches a better Objective-C code-style, but please still be aware of the possible core-changes that might effect your implementation in the feature. Thanks!

creating createM3FromEclipseProject in Rascal creates no data

I'm new to Rascal and have a very very basic question.
I'm using in a little test project the follwing command :
createM3FromEclipseProject(|project://example-project|);
and uses the code to extract data from a project
It only gives my {}... I assume that means that my M3 model is empty.
What am I doing wrong? It has to be something really basic..
Greets
Doerak
Have you followed the recipe in http://tutor.rascal-mpl.org/Recipes/Recipes.html#/Recipes/Metrics/MeasuringJava/MeasuringJava.html ?
If no: then please do because that example code is tested.
If yes, then it means there is no data in your project. This can be caused by:
there really is no code in your project. This can be remedied :-)
or the source path of the example project (with the Java code) is not configured to point to the place where you have your Java code. This can be fixed in the properties pane (right-click on the project and its the bottom option). From there on, find help on managing Eclipse projects on stackoverflow.com.

GTMBase64 is missing in iOS

I have added GTMBase64.h and GTMBase64.m file into my project.
However i can't use GTMBase64 in my code.
It only show GTM_INLINE instead of GTMBase64.
Is there any framework i need to add to use GTMBase64?
Thanks for any help.
I just got solution for my own question.
Here is complete solution if you want to use GTMBase64 in your project.
First download two GTMBase64.h and GTMBase64.m file.
GTMBase64.h
GTMBase64.m
and download another file too.
GTMDefines.h
And then add these three files into your project and run it. (remove autorelease if needed).
After that , you can use GTMBase64.

Resources