Saturday, July 14, 2012

Install Window-OS 7 on Mac-Pro OS X(Snow Leopard) via Boot Camp



--> Pre-requirement 
Licensed Window-OS 7 cd/dvd and a good internet connectivity  


--> Steps
1. Boot Camp Assistant

- Open Boot Camp Assistant
- Let the first option be selected 'Download the windows support software for this Mac' 
- Click on 'Continue' button.  Remember this download is only of supporting drivers, it does not download the OS software.
- Let it download all the supporting drivers for your machine.
- Once download is complete it will ask for storage location.
- Store it on external hard drive(Pen Drive). For me it got stored with the name 'WindowsSupport_underBootcamp'

- Now if 'Boot camp Assistant' is not opened then re-open it.
- Select the second option ' I have the Mac Os X installation disc that came with my mac or ……..' 
- Click on 'Continue' button. It will open next window 'Create a partition for Windows'.
- Decide how much you would wish to let windows use for me I choose 50GB and click on 'Partition' button.
- Click on Partition button then Insert 'Licensed Window-OS 7' disk and  click on 'Start Installation' and system will automatically reboot.
- It will now open in windows environment. Complete the windows7 set-up.

Issues
- Now even though you have installed complete new OS on your machine you still will encounter lot many troubles and most of them are because of drives misplacement. For eg. with me my installation failed to load network drivers so I wasn't able to connect to the internet. Then I realized even audio drivers too were missing.

Solution:
- Insert the 'Pen Drive' and unzip the 'WindowsSupport_underBootcamp' folder.
- Navigate inside the 'Boot Camp' folder and run the 'setup.exe'
- Reboot the OS and your windows machine is ready to use at it's best.


--> Note:
- Holding down the option key at startup brings up the boot manager, allowing the user to choose which operating system to boot.

OR
- If you are inside Mac environment and want to go to windows then open 'Startup Disk' 


And press 'Restart...'

OR
- If you are inside Windows-os environment then 'Bootcamp' will appear in your menu options. You can navigate to Mac from here.



--> Video guidelines are also available here


All the best for your installation.


Monday, June 4, 2012

How to create multiple targets in Xcode 4.2 for IOS Projects


If you want to build multiple versions of an application from a single Xcode project, you would want to cerate multiple targets. For example, when you want to release a free version and also a paid version, you should create 2 targets in that Xcode project.

This tutorial will cover 'how to add multiple targets' and manage their resources in Xcode project.

1. Create a New Target


Let's assume we have an application called 'MissionImpossible', which is a paid version. And we want to create a free version with reduced functionality or with very few playable levels.It is to note that both the paid version and free version would share the same code, with only some differences.

Firstly create a new target into the already exiting xcode project.


Let me call it as a 'MIFree'


Now what do you see is it has two different entry points i.e AppDelegate files

Depending upon the build target you have selected it will create the installer under products section.

Inside 'Build Phases' you can choose corresponding source files to compile, corresponding libs and corresponding bundle sources like ' .plist' files.


2. Info.plist


Now as the two resource files are separate from each other we can add necessary icon file, product name for each target.



3. Writing Preprocessor code

Preprocessor codes are used to determine which code would be used during compile time. You may want different targets to run different section of the codes using preprocessor codes.

Now 2 very important things here

1. Add User Defined Macro
By clicking 'Add Build Setting' and inside that click on 'Add User-Defined Setting'. It will one a new setting section in editable mode like shown in following image.


Type your own defined macro name without any space and it's value. 


2. Do not forget to initialize it, like shown in following figure.

With the flag LITE_VERSION defined, we could now write codes that will be compiled for the different targets. An example is shown in following fig.



When the active target is selected and being run, it will work and print correctly.



Now On a very important node, If suppose you already have an xcode project which suppose you have been monitoring since last few weeks/months then instead of step no.1 from this blog use following step.


Duplicate Target


- Right click on the existing target and say 'Duplicate'. Remember all the setting that has been implemented on this target will reflect as it is on this newly appeared target, that includes same product name, icon file and info.plist as well.

- Change them individually picking 1 by 1.

- Rest steps would remain similar i.e. Writing Preprocessor Code
This step is very much important and one may realize even though keenly following all the instructions still most of the time it does not work as expected.
Remedy is simple for me it work when first i select the necessary 'build target' , clean the project and quit the xcode project. Once reopened you will tend to observe expected results.(At least for me it worked like Gem)


Regards,