I'm looking for an Objective-C open source project with Makefile, but I didn't find anything like that. I need that to test my clang static analyser project. Is it possible to make an Objective-C project?
Using make for Objective C is certainly possible, and quite convenient.
Example is here: https://github.com/wkoszek/objc_edu/blob/master/makefile
Related
I'm making app with using Xamarin.
I have to bind some iOS framework which is written by Swift to CSharp.
Sad news is Xamarin does not support bind Swift framework at this moment, So I almost gave up.
But I have a question.
Header files of the library that I've built to framework looks Objective C. But All source code is written by Swift. (this framework : https://github.com/NordicSemiconductor/IOS-DFU-Library)
What is this?
Is this natural or they did something extra work to make it as Objective C when it's in framework?
This means that I can keep doing binding work?
Please correct me, if you have to.
As far as xamarin is concern, it doesn't matter if a Cocoa lib is written using objective C or swift, or C++ for that matters.
What you'll have to compile the lib into a *.framework compiled library using xcode. So swift or objc, well, doesn't matter.
Simply open the project in Xcode and build it. Obviously, don’t do build and run as you can’t run it (again unless you have a test suite). Now, look under the Products group in XCode and you should see a file called DFULibrary.framework.
Once you have the compiled binary, then you'll have to encapsulate it in a C# (or F#) iOS binding project (again, they say ios binding, not objc binding nor swift binding... guesss why :p ) as explain here : https://developer.xamarin.com/guides/cross-platform/macios/binding/objective-c-libraries/
Now, it's true that they say:
To do a comprehensive binding, you will want to understand the
Objective-C API definition and familiarize yourself with the .NET
Framework Design guidelines.
but I would pin that on a lack of update of the documentation. Just replace ObjC understanding by swift understanding :)
YOu will end up with a C# api anyway.
Enjoy
I'm going to give the source code of my program which need ws2_32 library to some rookie programmers who don't know a lot about c++. So it should be as simple as possible for them. the Compiler of Visual Studio supports #pragma comment with which i can add library but I don't know what to do with other compilers like MinGW or GCC. Is there any code that I can add to my source so that the library links automatically?
I would just write a makefile that pulls in all the stuff they need. Easiest for you and them I suppose.
Or is there any real reason not to handle it with makefiles? I can't imagine anything being much easier.
I'd like to use Vim for editing sources and Xcode for all other purposes like managing, debugging etc. I've installed cocoa.vim plugin and it helps with highlighting, but I still need a way to navigate around the code. In java project I used ctags for the purpose, but it doesn't support obj-c.
So the question is: what is the easiest way to generate vi-compatible tags file for Objective-C sources?
I'm the author of the second link that jelera pointed to and must say it is now out of date.
I would follow the advice in the accepted answer of Alternatives to Ctags/Cscope with Objective-c? in order to get full Obj-C parser support in ctags.
If you use tagbar, this post will help get the new ctags binary working with it:
http://bastibe.de/2011-12-04-how-to-make-tagbar-work-with-objective-c.html
This is pretty much the setup I now use.
I am writing a Mac OS X desktop application in which I want to be able to parse fragments of Objective-C such as variable and method declarations, as well as full Objective-C header and source files.
It looks to me as if I should be making use of Clang to do this, but I could do with some pointers and examples on how to integrate it as a library in my project, and how to invoke it to parse strings and files.
Can anyone provide me with any help on this?
You probably want libclang, code browsable at http://llvm.org/svn/llvm-project/cfe/trunk/tools/libclang/ (though you'll need to checkout the entire Clang repo to build it). There's very little documentation around on it, sadly. There is a presentation at http://llvm.org/devmtg/2010-11/Gregor-libclang.pdf that might help kickstart things, but mostly just some hunting through the code is the way to go.
Clang is actually more modular than libclang provides for (you can import just the components you want). If you've adventurous, there are examples at http://llvm.org/svn/llvm-project/cfe/trunk/examples/.
I am looking for coding standard checker something like php_codesniffer (http://pear.php.net/manual/en/package.php.php-codesniffer.intro.php) for objective c.
Thanks,
Jose Antony
Maybe check out Uncrustify, there is also a fork with better Objective-C support. If you want to integrate uncrustify into xcode, read the blog post: Adding a code beautifier script to Xcode
The LLVM static analyzer is your answer.
In Xcode, you can use the build and analyze feature.
If you want to invoke it manually, see this LLVM web page.