This question already has answers here:
What are alternatives to Objective-C for Mac programming?
(13 answers)
Do I have to learn Objective-C for professional Mac Development? [closed]
(17 answers)
Closed 9 years ago.
I've been assigned a new task at my company to rewrite one of applications to Mac OSX. I just started learning about OSX programming and it looks like the native language of Mac OSX is Objective C.
Therefor I've a question - is Objective C the preferred way to write OSX applications? And also does anyone know if there are alternatives to Objective C? (I'm already familiar with C and C++.)
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
My company is currently planning on providing our services and UI components in the form of native SDK. What are pros and cons of building the SDK in Swift vs Objective-C?
Note: Our clients who will be integrating our SDK will be either using Swift or Objective-C.
I would highly encourage watching this talk by Jonathan Blocksom: http://realm.io/news/swift-objc-best-friends-forever/
It says:
"Swift and Objective-C work together fairly well, so there are many reasons why you would want to include both in a single project. There may be a handy Swift library that you want to use in Objective-C, or vice versa. If you have a big Obj-C codebase and you want to learn Swift, now would be a good time to do that as well. Swift was built for Objective-C compatibility and also works with C, but not with C++. Many types in Objective-C translate over to Swift fairly well: BOOL to Bool, NSInteger to Int, SEL to Selector, and so on."
In my limited experience, using Objective-C code from Swift is a more common use-case and fairly trivial. Using Swift code from Objective-C is certainly possible, but it has some gotchas: Specifically, check "Alamofire in Obj-C Case Study" in the video.
Alamofire is an HTTP networking library written in Swift, from the creator of AFNetworking: https://github.com/Alamofire/Alamofire
Also, I would encourage you to read the official document: https://itunes.apple.com/us/book/using-swift-cocoa-objective/id888894773?mt=11
I hope that helps.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've just learnt objective c for the purpose of app building for iOS. In fact i started tinkering this week with my first attempt at an app, I was unaware about Swift and I am reading the text blog on the WWDC.
Going forward, should I be looking to build apps in Swift rather than Objective C now? And are the languages fairly similar?
I ask mainly because I've only just learnt the syntax for Objective-C and done little playing around with it, so dropping it all together isn't too much of a big deal for me. What's more important is that I use the right language. I got my first mac only a few months ago and I've not had much experience with Apple so I thought I'd go to place where people who are far more experienced all round could help point me in the right direction. I don't know if Swift means that it's likely Objective-C will be dropped entirely at some point.
This answer won't stand the test of time, but as of today:
Objective-C will be around and supported for a long time. (Apple has a massive amount of Objective-C source code that it's not going to port to Swift any time soon.)
Almost all iOS tutorials, examples, and books use Objective-C.
Almost all iOS-specific third-party source code you might want to use is implemented in Objective-C.
It's easier to use C and C++ libraries from Objective-C than from Swift.
There are many Objective-C experts you can get help from. There are very few Swift experts.
The Swift language and its standard library are currently not very well documented.
Stick with Objective-C for now. When you're comfortable with the iOS SDK and Swift is better documented, you can consider learning Swift.
UPDATE
It's been four months and my opinion on this hasn't changed. If you're looking for a more recent answer, this Hacker News thread was asked and answered today: Is Swift ready for production?
This question already has answers here:
Objective-C for Windows
(14 answers)
Objective C on Windows or Linux
(4 answers)
Closed 9 years ago.
This is just an easy question!
I want to lean some objective-c but the problem I don't have a mac I've only PC with windows
is there any compiler and editor where I can type my code and run it on windows.
Thanks in advance.
Yes, you can learn Objective-C — for example, see here. But you won't be able to create OS X or iOS applications straight from a Windows machine.
You can try to install a Hackintosh or emulate OS X in VirtualBox or VMWare.
But, IMHO, all of this would be a real pain in the neck!
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Code linting for Objective C
Is there any lint tool for Objective-c?
Xcode includes the Clang static analyzer, labeled as Build and Analyze (simply Analyze under Xcode 4).
http://clang-analyzer.llvm.org/xcode.html
Edit:
OCLint, based on Clang, provides additional checks of code style and complexity.http://oclint.org
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What are best practices that you use when writing Objective-C and Cocoa?
Does anybody know a good reference about Objective-C/Cocoa Best Practices?
Project organization, methodologies, naming and etc.
See question
What are best practices that you use when writing Objective-C and Cocoa?
A great "K&R" style reference for objective-c is Programming in Objective C by Stephen G. Kochan.
As for versioning, definitely set up a version control system. I wrote a tutorial on that here.