Cocoa, XCode, Objective-C [duplicate] - objective-c

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Right programing language for developing application for Mac
I'm a newbie to programming, i know HTML and CSS, but in terms of non web-development languages, im an idiot. I wanna program applications for mac, not for ipod touch or anything, and just downloaded Xcode, but all articles i've read are very unclear about what languages to learn. What languages do i need to know to do this?

The language you need to learn is Objective-C.
Cocoa is the framework of libraries, API's, and runtimes for Mac OS X.
XCode is the IDE you use to program in Objective-C.
Think of it this way: you can learn Objective-C, but without Cocoa you would have a very difficult time doing anything in the OS X environment without an API, which is where Cocoa comes in.

The main language on OS X is Objective-C.
This is an extension to the standard C language, so knowing at least the basics of C would be a good starting point here.
Cocoa is the main application framework applications on OS X are using.
Get yourself a book to learn that!
I recommend the book from Aaron Hillegass.
It's amazing!

Related

way to create objective c program on another platform? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Objective C for Windows
iPhone development on Windows
Is there any way to build objective c or iPhone program on Windows 7 ?
or any other software that is same as Xcode.
i does not want to deploy, want to build and test for learning purpose.
i don't want to install Mac OSx using VMware.
You could get objective c compiler on your windows, but i dont think that you will be able to get the cocoa framework on it, so you could be able to learn objective c language but not cocao and cocoa touch
Some resources
Objective C for Windows
http://www.roseindia.net/iphone/objectivec/objective-c-windows.shtml
Yes, there are several solutions out there, but the first that comes to mind is RareWire. While you cannot design in objective-c, you can create iPhone apps on any platform that has a web-browser and send them to your device.
Unfortunately, at this time, RareWire is invite-only, so you would have to request an invite to get in.
If it's only for learning purposes with regards to the Objective-C language itself, meaning you don't need the Cocoa API, then gcc has a perfectly fine Objective-C compiler. See for yourself: http://ideone.com/395tl

Does Objective-C have views?

The rejection of a recent edit I suggested gave me doubts about something I thought I knew on Objective-C.
I've lived under the assumption that the UIViews are part of iOS, that iOS is a descendant of Objective-C and that Objective-C has no default kits with any views.
I've tried some Google and Stack Overflow searches, but the results didn't seem trustworthy and were mostly about UIViews. Wikipedia seems to mention nothing about this .
Does Objective-C have views? Or is that, as I assumed before, a common misunderstanding?
The problem that I see is that iOS is NOT a descendant of Objective C.
iOS is the operating system (like Windows Linux OSX) whilst Objective-C is a programming language albeit one that most iOS and OSX apps are written in. However there are iOS apps written in Python and other languages,
iOS as such does not have views - these are part of the Cocoa-touch framework which is a set of libraries that run on iOS and can be called with Objective C code. Although in practice for the programmer the difference between calling code in iOS and Cocoa touch is not really clear if you are only writing for iOS devices, the split is clearer in OSX where you can write code just using OSX calls or can use Cocoa frameworks.
As noted the views are part of the Cocoa touch framework. This can be called by any language including Objective - C. Most languages do not include the ability to write GUIS as part of itself they usually make use of separate libraries to do this. For example Objective C has no GUI libraries itself but has had Cocoa touch written for iOS, Cocoa and Carbon (although that mainly uses a C binding) for OSX and GNUStep for Windows and Unix like OSes (and historically NeXTStep, OpenStep, Rhapsody, basically earlier versions of Cocoa, on various OSs and Stepstone's ICPak 201)
Objective-C is the open source programming language. UIKit(iOS) and AppKit(Mac OS) are what provide the visual elements - and this is not open source.
Objective-C itself doesn't have a UI, that's provided by other frameworks.
From what I have understood obj-c's views are part of the UIKit framework : check here
which is designed for constructing GUI applications on the iOS.
I don't think you can use this framework in other obj-c applications but on iOS. Probably there are other frameworks that have views which can be used.
Edit: And yes, good point by #Mark that you are confusing the Operating System with the Programming Language

How do you write program for Mac OS X?

Hi just wondering how do you start writing programs for MAC OS X?
what language does it use? can I use objective C? which IDE do I use? any licensing fee should I know about.
Thanks.
Mac OS X is a great programming platform, as such you can use just about any language you like.
If you wish to write native applications using the Cocoa framework you'll probably want to be using Objective-C. You can download XCode as an IDE for free.
No licensing fees.
Xcode is the apple supplied IDE, and without external libraries some objective C is always required to build applications.
That being said xcode supports multiple types of langauges, and has extensions for many more - and C++ can be spliced in with objective C code - so if you prefer to code in C++ you can write a quick objective C wrapper and do all your own stuff in C++ - or indeed the langauge of your choice. There are a few other open source IDE's but I don't really recommend them - most of them crash on opening in new versions of Mac OS X.
Xcode is found in the developer package on your second mac install disk, or the latest version (with iphone SDK's) can be downloaded once registering on the Apple Developer Website, which you can become a basic member of for free.
As far as licensing goes, unless you plan to make a game for iOS there are no liscensing fees, unless you want a full subscription to apples developer website, which gives you a few extra things from them.
If your trying to write a game, consider using the SDL library, a cross platform wrapper for whole lot of operating system interface functions, including graphics - or you can use it as I do in combination with OpenGL for full 3D Support, hardware acceleration, ect.
Objective-C + Cocoa
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html
Apple suggests XCode
The native libraryfor OS X developed by Apple are called Cocoa. It provides OS X's graphical user interface, and other libraries such as Core Data for database acess, Core Animation for fast easy animation and video features in your software. These libraries are written in a mixture of C and Objective C (which is an extension of the C language). For best performance and best integration with the Mac operating system you should probaby look at developing in C, Objective C and perhaps some C++ as well.
There are some add-on layers that provide acces to the Cocoa libraries from other languages such as Ruby or Python. These are generaly of good quality and work well, so you can use these languages if your aplication does not need the very best performance. They are generaly considered to be easier to learn than the C family of languages and you can become productive very quickly.
Beyond that, you can use languages and toolkits that are platform-independent so your software will can run on Linux or Windows as well as the Mac. For example Python comes with a simple built-in GUI toolkit called Tkinter. You can use more powerful cross-platform toolkits such as Qt or WxWidgets with C or C++ but have excellent bindings for Ruby, Python and other langauges. This is an approach I am using of a project, with Python and Qt.
Others have mentioned Apple's integrated development environemnt (IDE) called XCode. I have only toyed with it, but it looks very powerful for true native development of Cocoa applications.

Tips for transitioning from Visual Basic to Xcode

I've been programming in VB.net for a while now, and I finally got access to a mac to make ipod apps. What are some useful sites, videos, etc. that could help me get used to Objective C and the Xcode IDE? I've stumbled upon the samples on the apple dev site, but none of them really give good examples which I could learn the syntax of the language from.
Thanks for the help, Objective C is really a big change from VB.net!
Here are some helpful starter references from the Apple site, first for Objective-C itself, then for the Cocoa frameworks.
Learning Objective-C: A Primer
Cocoa Fundamentals Guide
There are also "getting started" videos available from http://developer.apple.com/iphone (you have to register as a developer to get access, but that's free)
You might want to take a look at MonoTouch if you like working with .Net. As far as I'm aware, it only works with C#, but it will let you use the .NET api to program for the iPhone. Might be worth looking into if you don't want to learn Objective C.

Game programming on Objective-C and linux

I'd like to give Objective-C a try in game programming. The problem is I'd need some tools and libraries for this.
First thing that comes into mind I need is the GUI and graphics library.
What choices do I have?
There are Four non Mac implementations of OpenStep/Cocoa type Objective C platforms:
OpenStep/NextStep : Openstep/NeXT support machines only - Discontinued.
p..... can remember name or find it on web - it's out there somewhere ! - Linux
Cocotron - Windows only
GNUStep Linux/Windows
GNUSTep is the way to go for Linux... I mention there others because 2 and 3 are available in source and they can be used to patch holes in code the GNUStep doesn't have and they might.
When it comes to Graphics library - you may have problems because Apple moved away from the old OpenStep APIs and has kept evolving their APIs far faster than the GNUStep people can play catch up. There is no support for the latest graphics libraries such as Core Animation.
As Objective C is C and C++ friendly you can use any of these libraries as is, or by making the Objective C friendly by making a wrapper.
You may or may not want to be Mac compatible and do versions for that so it may not be important.
If you do you might want to do a Linux Wrapper for something like OpenGL if it is missing, which I think it is but have a check yourself....
There are Linux development tools including a project IDE and GUI builder for GNUStep on Linux.
Tony
I believe you're asking for GNUStep.
SDL is a C library which is popular for game programming.
If you're looking for Foundation/AppKit stuff you can also look at Cocotron. I've never tried it though.
Supporting SDL there are Objective-C bindings here. However since Objective-C is a thin OO layer on top of C you can use most of the existing C libs for game development, SDL, Clanlib, etc...