Monday, 28 October 2013

Disable Automatic Reference Counting for Some Files

I have downloaded the iOS 5 SDK and found that ARC is a great feature of the new Apple compiler. For the time being, many third party frameworks don't support ARC. Could I use ARC for my new code and keep the current retain/release code unchanged? The ARC converter doesn't work here, because some frameworks, such as JSONKit, cannot be converted to ARC by using the converter.



The answer is to add -fno-objc-arc to the compiler flags for the files you don't want ARC.


It is not very intuitive how to disable ARC on MULTIPLE files, for a while I was do it one by one until a figured out how to do that.
  1. Select desired files at Target/Build Phases/Compile Sources in Xcode (CMD+click or Shift+click)
  2. PRESS ENTER (double click will reset the selection, so it doesn't work)
  3. Type -fno-objc-arc
  4. Press Enter or Done

Monday, 21 October 2013

iOS 7 – Status bar Issue

Hi All ! I know everyone is struggling with new iOS7. One of the major issues for making app-user-interfaces compatible to iOS7 for apps which uses custom-layouts, I’ve found a quick solution & I hope you are going to like my quick-fix.


Step 1. Open project. Open to target-info.plist & add entries as illustrated here.
iOS 7 - Status bar Issue - Fixed in my style - 1
Step 2. Open AppDelegate. m & navigate to the app didFinishLaunchingWithOptions method & make sure you’ve a black window – see sample code below.
Step 3. Check the current iOS version.
Step 4. It’s an obvious that you are going to set a view-controller/navigation-controller/tab-bar-controller as a root-view-controller of your application-window. So, Assume, we’ve a tabBar as a variable/property of a tab-bar-controller & following code will explain you how to add & set it in a window. (Make sure you code frame-size with conditions if you are targeting both iOS7 & 6)
And you’re done. You would not need to do after this patch for iOS 7. I hope it helps to you all. Cheers.