Make Better Things

I like to make better things.

Open Settings app in iphone using Open URL Scheme

Update: This doesn’t work anymore from iOS 5.1
Thanks Toto.

Do you want to open settings app or any section of settings app from your iOS application? Now you can do this you can use below URLs to open different sections of Settings app.

Preference Shortcuts:
About — prefs:root=General&path=About
Accessibility — prefs:root=General&path=ACCESSIBILITY
Airplane Mode On — prefs:root=AIRPLANE_MODE
Auto-Lock — prefs:root=General&path=AUTOLOCK
Brightness — prefs:root=Brightness
Bluetooth — prefs:root=General&path=Bluetooth
Date & Time — prefs:root=General&path=DATE_AND_TIME
FaceTime — prefs:root=FACETIME
General — prefs:root=General
Keyboard — prefs:root=General&path=Keyboard
iCloud — prefs:root=CASTLE
iCloud Storage & Backup — prefs:root=CASTLE&path=STORAGE_AND_BACKUP
International — prefs:root=General&path=INTERNATIONAL
Location Services — prefs:root=LOCATION_SERVICES
Music — prefs:root=MUSIC
Music Equalizer — prefs:root=MUSIC&path=EQ
Music Volume Limit — prefs:root=MUSIC&path=VolumeLimit
Network — prefs:root=General&path=Network
Nike + iPod — prefs:root=NIKE_PLUS_IPOD
Notes — prefs:root=NOTES
Notification — prefs:root=NOTIFICATIONS_ID
Phone — prefs:root=Phone
Photos — prefs:root=Photos
Profile — prefs:root=General&path=ManagedConfigurationList
Reset — prefs:root=General&path=Reset
Safari — prefs:root=Safari
Siri — prefs:root=General&path=Assistant
Sounds — prefs:root=Sounds
Software Update — prefs:root=General&path=SOFTWARE_UPDATE_LINK
Store — prefs:root=STORE
Twitter — prefs:root=TWITTER
Usage — prefs:root=General&path=USAGE
VPN — prefs:root=General&path=Network/VPN
Wallpaper — prefs:root=Wallpaper
Wi-Fi — prefs:root=WIFI

Distribute Enterprise applications Over The Air (OTA)

iOS supports over-the-air installation of enterprise apps, letting you distribute in-house software to your users without using iTunes or iPhone Configuration Utility.

Here are the steps by which you can create OTA distribution for your Enterprise apps.

Step 1: Archive your project as usual and open Organizer.

Step 2: Select the file you want to distribute and press the Share button.

Step 3: Select “iOS App Store Package (.ipa) and press next.

Step 4: A new window will which will ask you to enter the name of the ipa file. There is a check box at the bottom of the screen “Save for Enterprise Distribution”, select this check box.

Step 5: The window will expand to look something like this.

It will ask you few information on where you want to host the file, its icons and title.

Make sure you enter the application URL to the complete url of the file you would host on your server. Then enter title, subtitle, large icon url (512×512) and small icon url (57×57). Once you select the “ok” a .ipa file and .plist file will save in your select folder.

Step 6: Now we need to create a html file which will have the link of the plist file. Here is the sample file -

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
  <title>Sushi App</title>
    <li><a href="itms-services://?action=download-manifest&url="> Tap Here to Install the Application</a>
</body> </html>

Notice the url in form – itms-services://?action=download-manifest&url=
The above is just a sample html which have only the link, you can create more good looking files but just be careful with the link.

Step 7: Now upload .ipa file, .plist file and .html file on the webserver (which you mentioned while saving the ipa file).

Step 8: Open the html file in safari and tap the link to install the app on your device.

What is the difference among nil, NULL, Nil in Objective-C?

They are all zeros, the difference lies in their types

-> NULL is a generic pointer value ((void*)0, to be specific). It points to 0×0.
-> nil is an id. So its points to a non-existent objective-c object
-> Nil is a non-existent objective-c class
-> [NSNull null] is an object that’s meant to stand in for nil in situations where nil isn’t allowed. For example, you can’t have a nil value in an NSArray. So if you need to represent a “nil”, you can use [NSNull null]

Also there is no ‘null’ in the objective c its ‘NULL’ not ‘null’. ‘null’ exist in Java or in C# not in Objective-C