ios - Can I code in Xcode 5 and then comment out the iOS7 specific code before I submit with Xcode 4? -


there few layout issues need resolve new ios version , there new method, let’s call newmethodthatisnotinios6 can use code fix them:

if ([self respondstoselector:@selector(newmethodthatisnotinios6)]) {     self.newmethodthatisnotinios6 = parameter; } 

this code works fine in xcode 5 won’t compile in xcode 4 because method not defined.

right now, comment out code when working on new apps ios6, there way compile in xcode 4? alternatively, can safely code in xcode 5 , strip out ios7 specific code before submit xcode 4?

you can exclude code precompile macro's like:

#ifdef __iphone_6_0 if ([self respondstoselector:@selector(newmethodthatisnotinios5)]) {     self.newmethodthatisnotinios5 = parameter; } #endif 

this include method compiling ios 6+ sdk , not used if compiling ios 5 sdk.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -