Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone ($4.99)

dotnetIQ ($4.99)

Your First iPhone App ($1.99)

iPocket Tools 9 in 1 ($0.99)

Catch-Me (Free)

Alien Strike ($0.99)

Historic Olympic Medal-Table ($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-24-2009, 04:17 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 8
Default Is linear programming possible in Objective-C?

Hello, I develop software for some 25 years. After that time, linear-style programming got so burned in my brain, it is very hard for me to switch to objective programming.

I have read in Tutorials that Objective-C is somehow "backward compatible" with old style programs. Is it possible to use linear programming and minimize use of objective programming in Xcode? For example, can I call methods and properties as some kind of functions?

Jan
jaybee is offline   Reply With Quote
Old 03-24-2009, 04:26 PM   #2 (permalink)
Former NeXTStep Developer
 
Join Date: Mar 2009
Posts: 996
Default

Objective-C was originally developed as a pre-processor macro expansion enhancement to vanilla C. Everything it did was converted by the pre-processor into C. So yes, you could (and I think still can) do it all with function calls.

But the syntax to do it is very, very ugly. And you'll need to do it a lot, to make calls to all the SDK APIs. You really, really really don't want to go that route.

Now, it's not that hard to write all your own logic in C or C++, and then just do the API calls in Obj-C. Apple used to have some pretty good examples on mixed programming, at least for Mac OS X. They would probably apply to the iPhone SDKs as well.

Try poking around on the Developer Connection website for examples.

joe
FlyingDiver is offline   Reply With Quote
Old 03-24-2009, 08:40 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 38
Default

ObjC is backward compatible in the sense that you can call regular C code from within your ObjC.
Depending on the type of app you're writing, you can possibly avoid a lot of the ObjC. But the UI Frameworks (where you get your standardized interfaces) are based on ObjC and you'll be pretty handicapped in this area if you don't learn it.
__________________
iPhoneApps:
Respotter - Worldwide image browsing and messaging.
AutoWeb - Automate your web logins and browsing!
substance21 is offline   Reply With Quote
Old 03-24-2009, 09:44 PM   #4 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 125
Default

FYI you mean procedural programming, not linear programming... that means something else completely.
bhearn is offline   Reply With Quote
Old 03-24-2009, 11:31 PM   #5 (permalink)
Registered Member
 
Join Date: Jul 2008
Location: Minneapolis, MN
Posts: 208
Default

Hopefully by "linear" you aren't looking for an objective-c equivalent of "GOTO 10"
Scuba is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements
» Stats
Members: 21,510
Threads: 35,794
Posts: 156,817
Top Poster: smasher (2,449)
Welcome to our newest member, dmf1978
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:02 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0