Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I was a couple of things about the future of this new language. I did a couple of web searches and got mixed results.

1. Will Objective C eventually be phased out meaning I need to re write all my old apps?

2. With Objective C writing for IOS or OSX is slightly different. I am wondering if anyone knows if it will be the same now for both? For example string.text or string.stringValue.

I am waiting to start Swift until it is officially released and not in the beta of of xcode.

Thanks!
 

SDDave2007

macrumors regular
Apr 12, 2007
197
1
1. probably not
2. Yes... iOS uses UIxxx controls and OSX uses NSxxx controls.... or at least that is what I have seen so far.... basically the frameworks are different.
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
Although the UI frameworks have some similarities, they are different enough that they are not cross compatible between iOS and OS X. The iOS UI frameworks tend to be easier to deal with.

The lower level frameworks are platform compatible. Occasionally you'll run across something you know about on one platform that isn't in the other. CIImage is one that comes to mind that has more options for OS X. For strings, you typically use NSString objects which I believe is identical between both systems. There are too many to list.
 

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
Although the UI frameworks have some similarities, they are different enough that they are not cross compatible between iOS and OS X. The iOS UI frameworks tend to be easier to deal with.

The lower level frameworks are platform compatible. Occasionally you'll run across something you know about on one platform that isn't in the other. CIImage is one that comes to mind that has more options for OS X. For strings, you typically use NSString objects which I believe is identical between both systems. There are too many to list.

That I can see. But I am wondering / hoping that Swift will be universal for both. We shall see I guess.

Thanks
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,345
Silicon Valley
With Objective C writing for IOS or OSX is slightly different.

Not true. The programming language is identical. Some of the frameworks and data types within those frameworks are different. String is not a native Objective C data type. NSString is part of the Foundation framework, which is not part of Objective C, the programming language.

One guess is that within 2 to 4 years, either Objective C or Swift will start being phased out, you can place your bets on which one. Which means you may have to rewrite either way you choose.
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,345
Silicon Valley
The languages will be universal. It's the frameworks that may have issues, especially UI stuff.

Not "may", the frameworks are currently designed to be different, due to different UI paradigms (mouse vs. touch) and legacy APIs. Apple management (unlike Microsoft) has been talking against converging them. Who knows if/when that will change?
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
Not "may", the frameworks are currently designed to be different, due to different UI paradigms (mouse vs. touch) and legacy APIs. Apple management (unlike Microsoft) has been talking against converging them. Who knows if/when that will change?

OK, I could have been more explicit on that response.
 

briloronmacrumo

macrumors 6502a
Jan 25, 2008
533
341
USA
1. Will Objective C eventually be phased out meaning I need to re write all my old apps?
Only Apple knows and maybe not even them at this point in time. Anything else is speculation even on MacRumors. What we do know: Apple's warning system ( with deprecations etc. ) typically provides years of warning ( calls deprecated in 10.4 are still available in 10.9 and Carbon is still available ). Clearly Swift is still buggy and not released, so I won't use it for real work. I'd also like to see how Apple improves it before committing. Objective-C works and does everything I need ( and more ) and I don't want to write hybrid code ( i.e. writing Objective-C in Swift because Swift doesn't have that feature yet - NSSet comes to mind but there are others ). My guess, FWIW, is Swift will need a couple of years to mature and kill the obvious show-stopper bugs. At that point I'd look at it seriously.
2. With Objective C writing for IOS or OSX is slightly different. I am wondering if anyone knows if it will be the same now for both? For example string.text or string.stringValue.
Again, only Apple knows where they are heading but the eventual consolidation of frameworks and UI seems possible. Among other things, Apple is a corporation driven by profits and lowering expenses. Maintaining two of everything is simply more expensive and likely to be on the current CEO's radar.
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,345
Silicon Valley
Apple's warning system ( with deprecations etc. ) typically provides years of warning

Typically... however some APIs, such as uniqueIdentifier have been removed with less than a couple years of warning. Others simply stop working after a single upgrade in device OS and SDK required for submission (iOS 6 rotation delegates, UI tint colors, etc.).

Again, only Apple knows where they are heading but the eventual consolidation of frameworks and UI seems possible. Among other things, Apple is a corporation driven by profits and lowering expenses. Maintaining two of everything is simply more expensive and likely to be on the current CEO's radar.

Driven by profits, yes. Lowering expenses, no. Around here they are hiring and constructing new office space on multiple sites like crazy. They currently seem to be driving profits by trying to increase customer value by more than they increase expenses. So what's the value to their customers of consolidating framework code used by developers? There is in some areas, but, at least according to their current public comments, not in all areas. They just increased the number of major programming languages for which they need massive support.
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
534
73
Utah
OpenTransport, which was ported over from Mac OS 9, started throwing deprecated warnings in 10.4, the headers (at least the atomic operations) were removed in 10.5, and said framework was removed in 10.9. Considering this, don't be surprised if QuickDraw is removed in 10.11 or 10.12, if it isn't in 10.10.

Functions and classes that have been deprecated in 10.9 or later aren't available on Swift. A little disappointing, but Apple doesn't want people using deprecated functions.
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,345
Silicon Valley
That said, even if Objective C starts being deprecated soon (the next WWDC), it won't be obsoleted too quickly, as Apple itself depends on a vast amounts of Objective C and C code (internal use stuff, as well as the more visible public frameworks and pro apps). Hopefully safe to use for iOS and OS X apps for at least another 3 or so years.
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
534
73
Utah
Not to mention the fact that, currently, Swift does not directly interact with C++ code, which some parts of CoreFoundation, Application Services, and related frameworks use (internally).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.