Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 3, 2008, 04:12 AM   #1
satyam90
macrumors regular
 
Join Date: Jul 2007
Location: Bangalore, India
Send a message via Yahoo to satyam90
Cocoa programming according to OSX Version

In Cocoa using Obj C programming"
I found some of the methods like NSFileManager's "createDirectoryAtPath:withIntermediateDirectories:attributes:error:" works only with OSX 10.5 and above. There are few other methods similar to that. In my application, I want to check the OSX Version and depending on the version, I want to implement the code accordingly. Is it possible to check the OSX version programatically and implement the code?
satyam90 is offline   0 Reply With Quote
Old Apr 3, 2008, 06:37 AM   #2
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
Well you have to build it against the appropriate SDK, why not just stick with the 10.4 methods?
__________________
If they have to tell you every day they are fair you can bet they arent, if they tell you they are balanced then you should know they are not - Don't Hurt me
Eraserhead is offline   0 Reply With Quote
Old Apr 3, 2008, 01:40 PM   #3
titaniumdecoy
macrumors member
 
Join Date: Oct 2005
CocoaDev: Determining OS Version
titaniumdecoy is offline   0 Reply With Quote
Old Apr 4, 2008, 02:19 AM   #4
satyam90
Thread Starter
macrumors regular
 
Join Date: Jul 2007
Location: Bangalore, India
Send a message via Yahoo to satyam90
Quote:
Originally Posted by titaniumdecoy View Post
I visited above site before posting the question. But it consists only upto 10.3.5 , but I am looking to have differences between 10.4 and 10.5

I am planning to migrate from 10.4 to 10.5 and so if my code consists of functions that can be used directly that works on 10.5, it might work faster.
satyam90 is offline   0 Reply With Quote
Old Apr 4, 2008, 03:40 AM   #5
Soulstorm
macrumors 68000
 
Soulstorm's Avatar
 
Join Date: Feb 2005
Location: Menidi, Athens, Greece
Quote:
Originally Posted by satyam90 View Post
I visited above site before posting the question. But it consists only upto 10.3.5 , but I am looking to have differences between 10.4 and 10.5

I am planning to migrate from 10.4 to 10.5 and so if my code consists of functions that can be used directly that works on 10.5, it might work faster.
Actually, in the above link I also see some code that will return the exact version of the system. It's the code that uses Gestalt.

Also, functions such as the one you describe are added for ease of use and to improve functionality, not performance. Check the documentation. Unless Apple says that a method is deprecated. you can use it and be sure that it will work on the current system and at least in the next major revision of OS X. So, you can use "createDirectoryAtPath:attributes:error" without worrying about having to use one or another. This function will work on OS X 10.0 and later.

It's best not to implement version-specific code until you really need to. If you really need to implement a function because it allows you to do something that otherwise you couldn't, then you should do it. Otherwise, you tend to break compatibility with earlier versions of OS X, and to restore it, you will need to write more error-prone code.

Just a thought.
__________________
Oramind: Articles, reviews Techlology and Art
If you don't like it, program it.
Soulstorm is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Applescript with cocoa Renmusxd Mac Programming 0 Nov 16, 2010 11:06 PM
How much do i need to know to read cocoa programming for mac osx? thekrazykid Mac Programming 1 Jan 4, 2009 10:42 PM
Migration from OSX Version 10.4.11 to OSX Leopard Server rjtmacturner Mac OS X Server, Xserve, and Networking 4 Dec 2, 2008 11:11 AM
How to change IP address via cocoa program/ other program KenLin Mac Programming 10 Jul 5, 2007 05:04 AM
OSX versions of these Windows Programs? Steve Jobless Mac Basics and Help 3 Sep 25, 2006 09:52 PM


All times are GMT -5. The time now is 10:03 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC