Wednesday, August 31, 2011

#pragma mark directives in code to help with organization as implementation files grow.#pragma mark is simple to use,

for example, insert the following to call out initialization code:

#pragma mark -

#pragma mark Initialization

Once this is in place, the Functions Menu (in the navigation bar) which shows a list of locations within a source file (e.g. definitions of classes, functions and methods) will display a new marker with the label "Initialization." The code in line 1 will add a line separator inside the Functions Menu, in this example, with the line appearing above the "Initialization" marker.

The figure that follows shows an example of how you might use #pragma mark to divide up various sections of your code.

Two notes:

You cannot have a space after the "-" in the #pragma mark -

If your code does not appear as expected (e.g. the separator does not appear), check that ‘Sort list alphabetically’ is not checked in the Code Sense preference settings.

Register your iPhone/iPad/iPodTouch: If you haven’t already registered your devices with Apple Developer iOS Provisioning Portal then first you have to register your device. Just go to “Provisioning Portal” on Apple Developer portal and click on “Devices” to add your devices.

9) Now run the iOS 5 beta file that you downloaded. (It ends with .dmg). It will show the file that ends with *.ipsw. For now just remember where the file exists.10) Open XCode. Open “Organizer” within XCode. Window -> Organizer11) On the left part of window you will see your device. Select it. If it’s not already in development mode, you will see option to “Use for Development”.12) Click on “Software Version”, Select “Others” and select the iOS 5 beta file that ends with “*.ipsw” extension.

13) Now click on “Restore ”14) It will take few minutes and your device will be ready to use with iOS 5

A Gizmodo reader has discovered a “backdoor” that allows you to install iOS 5 on the iPhone and enjoy all of its features without having to register its UDID with Apple first…

This workaround takes advantage of a Voice Over security flaw within the activation screen. Here’s how to do it:

First, you’ll need the iOS 5 firmware, which you’ll find with a quick Google search. Now, update your device in iTunes by holding the ‘Option’ key while you click the ‘Check for Update’ button, then select your iOS 5 IPSW file. When your device reboots, you’ll be greeted by a new activation screen.

Now follow these steps:

1. Triple click the home button. This will activate Voice Over.2. Triple click the home button and Emergency Call will appear.3. Click on Emergency Call and, while it’s switching, swipe your three fingers down.4. The Notification Center will appear!5. Click on the Weather widget. The Weather app will load.6. Click on the home button to exit to the iPhone’s springboard.

Your device should now be activated and fully functional with the iOS 5 firmware.

While this is incredibly cool, and a great way to get your hands on iOS 5 early, we don’t recommend you try this on your primary device. If anything goes wrong, you’re stuck with an iOS 5 beta that you can’t activate, and an iOS device that will be nothing more than an expensive paperweight until this Fall.

Monday, August 8, 2011

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.Step 3: Xpand classes and notice Interface Builder created the VideoPlayiPhoneOS4ViewController class for you. Expand Resources and notice the template generated a separate nib,VideoPlayiPhoneOS4ViewController.xib, for the “VideoPlayiPhoneOS4”.

Step 5: In the VideoPlayiPhoneOS4ViewController.h file , we have created instance of MPMoviePlayerController class, that manage the playback of a movie from a file or from the network, and create a instance of NSURL class . So make the following changes in the file.