Does RubyMotion support integration of objective-c code? - objective-c

There are a ton of libraries/pieces of code that have already been built in Objective-C can RubyMotion use these bits without rewriting them in Ruby?

There are a couple ways to do this. One is by vendoring your 3rd party code into the vendor directory and then using the app.vendor_project method in your Rakefile. See Using 3rd Party Libraries for an example.
Another option is using Cocoapods. With the motion-cocoapods Ruby gem, you can add any of the libraries here using something like this:
app.pods do
dependency 'JSONKit'
end

Related

how to compile objective c file in google native client?

I have a npapi plugin(bundle) for chrome, which use C++ and objective-c. now it needs to be build by google native client.
I wonder that can nacl support objective-c? how to compile o-c file by MakeFile
And if possible, how to build nacl plugin in Xcode? I tried, but i found that the libraries of nacl are " archive with no architecture specification".(use lipo -info *.a)
I hope someone to help me, thanks a lot!!!
If you use Objective-C without any of its usual libraries then you should be able to use the PNaCl toolchain (which is based on LLVM) to have it parse Objective-C. I'm not aware of projects that have done this, so you should definitely let folks on the mailing list know if you get something working (do keep the questions on SO, though!).
It sounds like your application won't be running on the open web (where only architecture-independent PNaCl can run, not NaCl), so you could either use the PNaCl toolchain to create a .pexe, or you could use the same toolchain to create a .nexe for each architecture you target. The documentation I linked to helps with both approaches, but note that using the PNaCl toolchain to create a .nexe is currently being improved. You can therefore follow the instructions on the bug tracker, or try out nacl-clang when it's released (or build it yourself if you're brave).

Build a library for Swift and Objective-C

I need to make a library with swift that support both swift and object c project (also support xcode 5), this will be a distribution library (do not share source code). There are two ways to do this: create a Cocoa Touch Framework or create a Cocoa Touch Static Library. I make some research, but still find out the solution. It seems the Cocoa Touch Framework not support to buid a distribution library, and I'm not sure the Cocoa Touch Static Library work perfect with with Swift yet or not. Any solutions for it. Thanks.
A very good example for this kind of library is Realm.
They both support swift and objective-c project integration. Check the repo on GitHub , and browse it : here
In fact, they have all the library coded in Objective-C, and the add Support for swift specifecity with extensions on objects used by the client. (For example, check the Realm/RLMSwiftSupport.m in their repo)
EDIT
To access a Swift class in Objective-C, just add #objc(MyClass) in your Swift Class and it will be available in Objective-C files.
Read the this for more informations about Objective-C and Swift working together
I faced the same issue as you to build one Pod library for both Swift and Objective-C, using pure code respectively without messing languages or include bridging headers. Actually I didn't try it by myself, but I came to several possible solutions:
1) To use a different branches of the same repo:
pod 'YourPodLib', :git => 'https://github.com/user_name/YourPodLib.git', :branch => 'objc'
pod 'YourPodLib', :git => 'https://github.com/user_name/YourPodLib.git', :branch => 'swift'
2) Experimenting with Subspecs as a way to install a subset of your library. (official cocoapods documentation: subspec )
It probably would look like:
pod 'YourPodLib/Swift'
Maybe my approach is far away from being ideal, but I would be appreciate if you correct me or suggest a better idea.

How to use cmake to compile autoconf project?

I'm using cmake to build my project, and I want it to integrate with a third party library called Project_A that using autoconf to generate make, how to write the CMakeLists.txt to build the Project_A and my project together?
Thanks!
I think using the ExternalProject module in CMake would be the best solution. See here for a good introduction to the api.
If you are wanting to do lexical code reuse (ie, copy-n-paste the code rather then relying on a dependency), then don't stop half way. By using the external code in this way, you are essentially claiming ownership of it for the purpose of your project, so there is no need to keep the autotool build. Just pull the code out and build it via cmake. Don't bother trying to create a hybrid build.

Where is the libOAuth.a source?

Nowadays, I'm working on an iPhone project that is using social connections such as Twitter, Facebook..
When I tried to implement Twitter+OAuth solution into my project some another parts of project such as MySpace is giving error on oAuth implementation. It seems MySpace IOS SDK used old version of oAuthConsumer project.
So, I haven't find libOAuth.a source code. If I find it I will be handle my problem.
How do I find the libOAuth.a static library source ?
try downloading it from https://github.com/bengottlieb/Twitter-OAuth-iPhone/blob/master/Twitter+OAuth/Libraries%20&%20Headers/libOAuth.a?raw=true
Isn't this what you're looking for? And not only do you have to include it into the project but also make sure you copy into it. Then under Build Phases, you will have to add this to Link Binary to Libraries section.
You might find Google's new OAuth 2 library for Mac and iOS to be helpful.

is FTS available in the iOS build of SQLite?

I am interested in using the full text search capability of SQLite.
I understand it was not compiled in to the iPhone/iOS version.
Is this still the case?
It is not available in the standard build of sqlite3 on iOS But you can still use it.
The best way to use it is to download the sqlite3 amalgamation and configure it for FTS3. Add the sqlite3.c and sqlite3.h file to your project and remove sqlite3 from your frameworks list on your application.
Statically adding it this way will work perfectly.