no route.h on the iPhone SDK - iphone

I am trying to build some code that is originally target at OSX/BSD/Linux for the iPhone. It uses struct rt_msghdr from route.h but as it turns out this header is not available in the iPhone SDK.
Looks like the function tries to find the available bind addresses as a list of struct addrinfo.
Does anyone have a suggestion how to proceed here?

Copy the header into the project and change the includes to be local, that often works for me.

Related

Native URL Endpoints .plist for Ionic2/Swift stack

I work on a Ionic2/Cordova project and I am developing custom native plugins for accessing rest API's. As native, the language is Swift which is transpiled with Objc decorators to be able to match with Cordova.
For accessing this API's I need some strings with url endpoints. This is mocked right now by using a key value dict but I want to move everything into something accessible by every native plugin. One suggestion was to create a .plist file (URLList.plist) with the content of this dictionary
From what I understood, on a native project this would be in the resources and it would be called like this: Bundle.main.path(forResource: "URLList", ofType: "plist").
I don't know where should I add this plist in the Ionic project so that it will compile well so I can reference it in the Native code. I tried almost everywhere in the structure but I can't figure it out.
Thanks in advance!
I solved the issue by using cordova-custom-config
Adding then to the config.xml the required dictionary, on ionic build platform it will build and populate the plist.
After this, I used Swift to get the dictionary values.
I mainly solved the problem, though, I wanted to use a separate plist, not the main project plist.

Compiler error when using AlwaysRightInstitute/SwiftSockets

I'm try to write a small game on IOS using socket and I've had a java socket server running with Flash client, but I got complier errors when I add the AlwaysRightInstitute/SwiftSockets source code to my swift project, and I did nothing after doing this
Here is the project structure:
the selected group "ARISockets" is the source code I drag into my project
and here are the errors(Use of unresolved identifier 'ari_fcntIVi'):
It seems that the errors cause by lack of some import file and I found "ari_fcntIVi" in ARISockets/UnixBridge.c,but I'm a really newer to Swift/Objective-C/C (I'm a AS3 developer), so that sucks me :/
I had the same problem with this library.
You need to create a Bridge file similar to "Import Objective-C into Swift" but this is C:
How to call Objective-C code from Swift
The issue was that you just copied over the sources instead of embedding the SwiftSockets framework. The ari_ prefixed functions used to required the bridging header of the SwiftSockets framework.
Having said that, the current SwiftSockets doesn't use bridging headers anymore, and you can directly embed the sources.

I need help on accessing address book in Flash Builder 4.6 - Win 7

Hey guys so I am trying to dev a app for IPhone and am very very stumped right now. I have tried using Contact Editor - ANE (http://extensionsforair.com/extensions/contact-editor/#comment-7488) but I get an error:
VerifyError: Error #1014: Class pl.mllr.extensions.contactEditor::ContactEditor could not be found.
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at ADLAppEntry/run()
at global/runtime::ADLEntry()
I made sure I included the correct file path under the ActionScript Build Path, besides that I don't know what else I can do. I do get the function like ContactsSimpe() function that hints when looking for a function. So I know it is connecting but once I go to compile and test in the flash pro I get this error. Here is some code that may help:
code....
import pl.mllr.extensions.contactEditor.ContactEditor;
public class soscode extends MovieClip {
var contactEditor:ContactEditor;
public function soscode() {
stop();
init();
contactEditor.getContacts();
}
code...
in my project window on left the .swc file for the native extension is in the reference folder. That is about it.
I really need some help on this an if you could give me a hand I would much appreciate it!
David,
Please let me know if you need anything else.
I'm guessing this might be a bit late now, but I've just been having this problem myself, and it was caused by the ANE not being packaged with the app when it's sent to the device / simulator.
Classes within the NE weren't being found at runtime, but were accessible in Flash Builder.
It turned out that by default the .ANE file wasn't copied to the device.
To fix this, change the following project property:
ActionScript Build Packaging -> Apple iOS -> Native Extensions -> Check 'Package' for the ANE
No idea why it wasn't included by default. When you uncheck 'Package' you get a warning telling you that it may cause runtime issues!
Hope this is of use for somebody.

iOS Application framework

I have created an ios application that can talk to the database and get the messages from the server and all i want to do now is to distribute this aplication as a templet and other application can import my current project and use it, Now i been went throw many tricks and tips such as making an Static framwork using xcode bundles and Aggregate target type and got it work with some script found hear: http://codefriend.blogspot.com.au/2011/09/creating-ios-framework-with-xcode4.html
what i want to know is whether its the correct approach for such a problem or should i been looking at something else. All i want to create is an framework for my team so that they can produce other application
without worrying about or writing same files and code again and again. And is it possible to bundle all the .xib and .html files too?
This is what we use to create framework:
https://github.com/kstenerud/iOS-Universal-Framework

Create an App within an App

I am being presented with a very interesting project. The task that I must complete is to figure out a way to allow a partner to be involved in an app without giving up their source code. The code will be included in the main bundle of the app so it is not dynamically stored. The partner has a fully functional app that is needed to be ran in a window within the main app at the appropriate time. I know having the partners create a web app would be ideal so it is treated like a webpage but I am more concerned with codes that must be written natively in iOS.
My question is what is the best way to go about solving this? In theory it is like an App within an App. Is there a way if they gave up their .app file I can include this in the bundle and then run it when I catch a certain event? Should I have the partners create their code in a framework and then import into the shell project? What is the best way to approach this problem?
If your 2nd-party doesn't want to provide you with the source code, why doesn't he compile it to object code then let you simply link it to your app?
By the way, at least on official (non-jailbroken) iDevices, apps can't 'embed' or 'open' one another in such a way - you can open an app programmatically if 1. it's a separate app 2. it has a registered special URL associated to its bundle.
Is there a way if they gave up their .app file I can include this in
the bundle and then run it when I catch a certain event?
No, you'll want to have them create a library instead. You can then include that library in your project.
Creating a library is as simple as:
Choose File->New...->Project... in Xcode.
Select the "Cocoa Touch Static Library" project template.
Add your code.
Build.
The result is a static library that you can add to your application(s). The library will contain the compiled code that you added, but doesn't include the source code. The library developer should provide whatever header files are necessary to use the code in the library.
An App within an App is possible however it requires a common data framework that allows one app to reference the same data without confusing the the source of and destination of the data.
Such a framework allows one app to interact with another app referencing the same data.