Languages in XCode - xcode

I'm just about to start learning how to program using XCode. I've had Java lessons in my school for half a year now, and will continue with that for the next 2 years.
As far as I've looked into XCode, it looks like it just uses Objective C, which at my brief first sight, looks pretty different from Java syntax-wise.
Look at C at the other hand, looks a lot more like Java.
Now I am wondering, is it possible to write iOS applications in C using XCode? It definitely would easen up my learning curve not having to learn a whole new syntax on top of a new language.
Edit: If it is indeed possible, would there be any disadvantages in using C instead of the (seems encouraged?) Objective-C?

First of all welcome in XCode.
XCode is just an IDE. Now it is on you, whether you want to learn iOS or MacOS Applications.
And I would suggest you if you have a good knowlegde of C, then have some knowledge on Object oriented language like C++ or Java. Then you will feel comfortable with Objective-C.
Objective-C is a language, superset of C, so not much to think only one day learning is required to see the changeover from C to Obj-C.
And Obj-C language makes framework called "Cocoa" which is the core for ios and mac based development. This will take some time, but mind you, you will get thousands of API, which are easier to use and remember than what you will make and use from 'C'.
You can refer many sites, I would like to share my learning process with you.
You can follow these, even I started learning with these sources.
Stanford lectures CS193
Lynda's Videos
Cocoa Programming for Mac OS X by Aaron Hillegas
Cocoadevcentral.com
Last one is of course Stack Overflow... This is the best place to sort out all your doubts.

You can effectively write most of your app in C but when you interact with the iOS SDK, the part that communicates with the device, you will need to use obj-c. Objective-c isn't hard to learn really, don't feel daunted about it.

You definitely can write code in C. Objective-C is a C language wrapped by defines.
However, I'd recommend to learn Objective-C. This allows you to write code using Object Oriented principles. There are numerous online tutorials for this.

Related

Cinder or pure OpenGL for iOS development

As im quite new to obj-C but on the other hand a common user of CPP and ANSI C, im a bit out of my comfortzone working with obj-C.
So people might ask, why i dont learn obj-C? Id love to learn it, but unfortunately im in a very tight schedule due to my uni project i would like to get as much working as possible.
I have worked a little with obj-C and run through tutorials, but i dont see myself being capable of creating big amounts of precious code as i would with CPP.
Yesterday i got familiar with Cinder framework and tried out some examples, which resulted in quite rapid results, especially with OpenGL and math libraries.
What bothers me right now is the capability of working with the XCode interface builder and binding the storyboard or xib files to the project.
Is there a creative way to combine the great GUI with Cinder in XCode, or am i "forced" to go back to pure obj-C and my libraries?
Thanks.
Have you looked into any of the frameworks built using other languages you may be more comfortable with that are specifically designed for iOS (and Android) game and app development?
ImpactJS - http://impactjs.com/
Corona SDK - http://www.anscamobile.com/corona/
The key features with these as well is that you write your code once and it works across multiple platforms, and may be easier and quicker for you if you know JavaScript or Lua (and the learning curve is smaller on these languages typically anyways).

Mac OS X programmig intro

I have been using Mac for a while and I am a senior CS major. I want to start making apps for Mac however I dont know where to start. Currently I know java, c++ , c , python as my main languages. Do I need to learn another language like objective-c ? Can anyone point me to a place to start ?
Well, the first two things you will need to do is learn how to use Xcode and then you will need to learn Objective-C.
To learn how to use Xcode, I would start with the Xcode Workspace Guide
To learn Objective-C, Apple has a great, free book - The Objective-C Programming Language. The one aspect of Objective-C which makes it easier to learn for many is that it is a true superset of C (C++, for example, is not). If you already know C, Objective-C just adds a little bit to support objects.
Then, I would pick up a copy of Cocoa(R) Programming for Mac(R) OS X (3rd Edition) by Aaron Pablo Hillegass. This book is the standard for starting out to learn Cocoa and build real Mac applications.
Yes, you will need to learn objective-c. Start here.
Yes, you should learn Objective-C. While there are other ways to create applications for MacOS X, the Cocoa framework is the best supported and the one to know going forward. Given that you already know several other C-based languages, picking up Objective-C won't be all that difficult. You'll spend much more time learning to use the framework properly than learning the actual language. I'd suggest picking up a book to get you started, and also get familiar with the Cocoa documentation.
actually it's for iOS development but they provide also and good introduction into --> Objective-C Intro
Objective-C is the official language to use when writing applications for the Mac, although since it's a superset of C, you can also use C code in your app.
Here is a good starting point.

Scripting languages in XCode

I notice that Java has a number of ancillary scripting languages. Clojure and Groovy for example. My understanding is that these can be used when the full might and power of Java does not need to be applied and a speedy cludge can be hacked in Groovy/Clojure. But at the end of the day the scripting tools contribution gets compiled into the application
Question 1. Is there a similar scripting in XCode? I was not so interested in Python or Ruby in this situation as they are languages in their own right added in, as indeed I think can happen in Java, but I was looking for a purpose built tools.
Question 2. If there is such a tool would it count the application out vis-a-vis the new Apple guidelines as to what can be used to generate iXxx apps?
F-Script is a scripting language that integrates well with Objective-C/Cocoa applications. Might not be exactly what you're looking for, but it's worth a look.
For such things there is AppleScript, with its own IDE AppleScript Studio. It has bindings to control Cocoa Applications, be embedded inside of them or even work as stand-alone scripts.
The problem is that it cannot be integrated inside iXxx applications because iPhone-OS Cocoa Foundation framework doesn't include it.
As mentioned by mipadi, you can use F-Script for Cocoa applicaitons.
If you are staying mainly in C, then Lua is another option.

Is Smalltalk a viable development language for Mac OS X?

Every time I see a discussion on software development, always someone suggests or exalts the qualities of Smalltalk, be it the beautiful language constructs or the better implementation of basically everything.
So I was curious, is anybody developing in Smalltalk? can Smalltalk actually be used to develop software on the Mac? Or what is the target platform for Smalltalk? What is the poster child for this apparently fantastic but unpopular language?
Smalltalk isn't really used for GUI application development on the Mac in any major way. The only distribution that could produce native apps was Ambrai Smalltalk, and that died in beta AFAIK. Squeak is the most popular Smalltalk variant nowadays, but you will be torn limb from limb if you release a Mac OS X app that looks like Squeak. It's worth checking out if you're interested in learning the language (which is still unique in a lot of ways), but you're probably not going to be developing OS X apps with it.
If you would like something similar, check out MacRuby. Ruby is as close as you can get to Smalltalk without actually being Smalltalk — total object orientation, dynamic, 100% message-based, heavy use of blocks, etc. MacRuby is an implementation being developed by Apple specifically for making OS X applications.
Mac OS X's native Objective-C is also heavily Smalltalk-inspired (it's basically a big chunk of Smalltalk's object system and syntax bolted onto C), but owing to its extreme C compatibility, it falls a little further from the tree.
Take a look at fscript, which is essentially a smalltalk-like language for Objective C.
Luis: do you want to do desktop application for Mac ? or you want to program in Mac? If you want to do a web application for example, you can perfectly use Squeak or Pharo. If you want to do native mac applications, you should see the Mars project for Squeak:
http://smallworks.com.ar/productos/Mars
As an example, most of the Pharo users and developers are under Mac.
http://www.pharo-project.org/home
download and try it at least for a couple of hours!
I still believe that Squeak is well worth investigating, if only to broaden your mind a little. As for the poster child for Smalltalk, it's probably Seaside.
Squeak isn't its UI. You can configure Morphic heavily (look at how similar Pharo's is to OSX, for instance). Or you can just use native widgets with wxSqueak.
This deserves some attention:
"Objective-Smalltalk was created specifically to solve practical problems that have been encountered in 25 years of Objective-C and Smalltalk use, but with a theoretical framework that solves many of these problems elegantly and minimally, rather than by bolting on special feature after special feature."
http://objective.st/

osx & windows development -- for newbies

my background: i've been developing web applications using php and javascript for the past ten years. before that, i've developed applications using turbo pascal for DOS. in my opinion application and web application development are two different kinds of development (at least it's what i think when i remember back the old days of DOS application development).
now i am in the need to go back to "normal" application development for various reasons. the application i want to build needs a GUI and it has to run on osx and windows. as mac os user it would be very nice for me to get an application as result, that really feels like an osx application. i don't need any special UI components: an explorer/finder like tree, a datagrid and some form-elements would be enough for my needs.
now the problem is, that i don't know where to start: i would classify me as newbie, because it's that long time since i last developed anything other than a web application. are there any recommendations of programming languages and gui toolkits with a not to steep learning curve? or can you recommend any book i should read for getting into cross-plattform osx/windows app development?
many thanks!
thanks everyone! i think i'll have a look at realbasic!
Edit Nov 2011 - a retraction
Most of what I say below is still true however I have now got serious reservations about recommending REALbasic for anyone trying to release commercial-quality applications. To save me remembering to edit this post later, see if RealSoftware have managed to release a robust version of their IDE using the Cocoa version of their frameworks. If not, be very cautious.
It's with a heavy heart that I write this because I still really like the language and think the framework and IDE are well-done. The problem is apparently one of under-capitalization and possibly a software development culture inside the company that consistently fails to deal with a bug regression problem. Many bugs are fixed each release but there appears to be a huge tax on the developers in the number of introduced bugs. They have a very small team for the complexity of the product, especially considering the newly released Web Edition which is effectively an entirely new platform.
It's still theoretically a great product but take advantage of the trial period, test it thoroughly on each of the platforms you plan to target and decide if you can live with any bugs you find because they may be there for a while.
REALbasic.
The language is a powerful, modern OO language that won't be hard for you to adapt to from your vaguely remembered Pascal or current JavaScript. It has most of the power of C++ without the dangerous bits that make debugging a nightmare. You will also find the IDE simpler and easier to deal with than say Visual Studio.
The IDE makes it very easy to throw together a GUI and have it just work on multiple platforms. The Pro version has one of the best cross-platform debuggers I've used and it is easy to just work (say) on a Mac and develop for Windows and Linux, compiling and testing with one click.
There is also a thriving community including many people at your level of expertise so you won't be mocked for being a newbie.
I am a professional software developer with over 25 years experience and currently mainly working in REALbasic, C++, C#, Objective-C and a bit of Ruby. For apps such as you mention, REALbasic is my tool of choice.
edit: I can't believe someone downvoted this but didn't have the guts to add a comment explaining why. I'd heard about prejudice against REALbasic but this is the first time I've encountered it. In what way was my answer inappropriate for this question?
Just to add to my cred, I've implemented cross-platform frameworks used by systems deployed to tens of thousands of end users - I have the C++ cross-platform experience to applaud someone else doing a good job and the REALbasic frameworks are very nice.
The best cross-platform tool I've dabbled in with a relatively small learning curve...especially if you're familiar with Visual Basic...is REALbasic. With REALbasic Pro you can compile a program to target Win32, Linux, and OS X from the same codebase, as long as you're not using OS-specific calls and features (which you can do with plugins or direct calls). Their support has been pretty responsive to my questions, the personal edition (which compiles to only the single target platform you'd downloaded the IDE for) is free for Linux and inexpensive for other platforms, but really you might want to download and try it out. One IDE, relatively inexpensive, and can compile native applications on OS X, Windows, and Linux...it's less hassle, and for me that's important when you want to get a job done.
I'd advise against C and Qt and would also recommend REALbasic.
With your background in Pascal and probably JavaScript you'll feel much more comfortable with REALbasic. I've done a lot of coding in Pascal and C/C++ - where Pascal guides you to avoid programming mistakes, C lets you step right in, even invites you, and then you'll have a hard time figuring out why it went wrong. Qt is a very abstract framework and requires you to learn a lot before you can get something working, just like with C. When compared to the easyness we used to have with TP back then.
RB is much more like Pascal in this regard. And its IDE is quite modern in regards to supporting your programming, with an easy-to-use GUI designer, straight-forward editor to fill in the gaps for handling UI events, code completion, etc.
Only when you get into huge program sizes, RB loses some of its appeal because it is missing tools to give you a good overview of complex class interactions etc.
Another thing is that Qt is more likely to cause ugly-looking Mac apps than RB would. RB visually guides you to get it all aligned nicely - in Qt you have to work with numbers, offsets, etc. to position your objects (at least it was that way when I used Qt 2 years ago).
I've written quite a few x-platform apps in RB and am pretty happy with the results.
You won't probably write those super-nice looking apps that compete with the best on the open small business market, but if you just want to get some solid code working, with an easy-to-design UI that's acceptable to the average user, give RB a try.
It's not free, though. But its rather small community is on your side - they're eager to help, instead of bashing everyone who's trying to talk sense :)
I'm new here but picked up on this thread through the REALbasic User Group. I think my position was similar to yours. I did website design for my work, using mostly javascript (with a little php, not much). I had a Pascal and BASIC background. I'd dabbled it C but didn't like the level of detail you needed to monitor it. It reminded me too much of assembly (which I still have nightmares about from my high-school/college days).
I was looking for a cross-platform language, with a familiar feel to it, but initially started with VB because it was free. I prefer programming in MacOS however, so I tried REALbasic. I found that REALbasic's UI builder was much easier to use than VB's. I'd echo other comments that the community is the most responsive of any user groups I've been involved with. I've since used REALbasic and my Mac to make several programs that over 100 users use every day at my work (on PCs, mostly XP and 2000). I've received compliments on the polish and ease of use of these programs. You DO have to remember to adjust the 'little' things to make it look right cross platform (ie: default button placement is opposite on PC vs. Mac, button sizes are different on Linux, etc). Many people have donated custom classes that do this stuff for you though.
People seem to assume that a "BASIC" language cannot be powerful enough for their purposes. While it is BASIC at it's core (with For..Next, Do..While, and If..Then commands), it ain't your daddy's BASIC. It's much more OOP than anything else I've used, based upon an event-driven structure, which for me was easy to pick up. They have a free trial, so grab a demo and run through the tutorial. If you get stuck, ask for questions on the NUG or Forums at the website and you'll likely get an answer quickly.
You may be interested in the following questions and answers:
Cross-platform development - Go with a cross-platform UI toolkit or native on multiple platforms?
Easiest cross platform widget toolkit?
Should I use a cross-platform GUI-toolkit or rely on the native ones?
Using a Mac for cross platform development?
and many others suggested in the Related sidebar of these questions.
Some answers suggest gtk (which is used by cross-platform gimp). Others suggest native approaches. Some suggest that a Mac is a nice platform for developing for Mac OS X, Windows, Unix and Linux.
I wholeheartedly recommend RealBasic too. I have been using RB for about 8 years now and find it to be a perfect tool for my Companies development needs, from small apps, to large multi-user systems.
It is perfect for beginners and those that are getting back into programming, and also for professional developers.
Highly recommended.
As Andy Dent and others here have indicated, for a newbie to create cross-platform applications it is hard to beat REALbasic (now Xojo).
Sure, there are plenty of other cross platform solutions such as QT (C++), Java, .NET (to some extent) and wxWidgets but they are not something a beginner would be able to use effectively.
I have many years of professional development experience in a wide variety of languages and technologies and I prefer to use REALbasic most of the time.
With that said, you might also consider Runtime Revolution or Adobe Air.
Whilst it might seem tempting to use a language thats platform independent and allow you to write the app once and use anywhere, you will undoubtably be sacrificing something on each, particularly in the UI and user experience.
If you can your best creating something using a native API that lets you take full advantage of the features of the OS to make your application shine.
I would definitely go for C++ and Qt, the code you write once will compile and run without problems on Windows, Mac and Linux. The new IDE that comes with Qt - Qt Creator is brilliant, works and looks the same on Windows, Mac and Linux, you don't need to anything else to start writing cross-platform applications.
I tried WxWidgets but didn't find good IDE, the best one was Code Blocks but GUI Designer is not perfect and has different problems on different systems and the IDE itself is still under heavy development.
Other options are Java and C# but those are not cross-platform languages, those are platforms themselves. Although you wouldn't need to compile code for each platform there will a lot of different issues on the way...
If your GUI's simple enough, why not just create a generic GUI layer, then program to that? Compile a version for each OS using native widgets. That's the best way to ensure native L&F on multiple platforms.
Both the Qt and REALbasic suggestions are good, although they tie you to that particular technology (which I can't imagine would be an issue in this particular case).
Personally, I'd go with Java, because it's worked for me before (I had an app that ran on my PDA, my phone and my desktop), but it doesn't use native widgets.
Adding a late comment here:
Take a look at Revolution. It's sort of like a modern Hyper-card on roids. And it's cross platform (Mac, Linux and Windows). This is a serious competitor to RealBasic and is coming on strong. Though I still use RB (and like it) I'm giving Revolution a serious look at.
I would also look into either Realbasic or Revolution. They both create cross platform native apps. Personally I think Realbasic would be a better choice as it is very similar, language wise, to VB. You can learn some valuable skills with RB and it can grow with your experience. I have been using VB and RB for more then 10 years combined and I think you will be happy.
If you need your code to be cross platform, you would have to go with something like QT.
Although, I would recommend using native API for each one (Cocoa for Mac OS X, .NET or the Win32 API for Windows). User experience will be much better. But of course, that will cost you more money in terms of developers hours.

Resources