Core Services
iOS Developer Tips - Visitor Stats:
|
|
|
Get List of Installed International Keyboards
The NSUserDefaults object is typically used to save/restore your application related preferences, configuration data, etc – see Write and Read User Preferences for more information. In addition to application specifics, there is a system wide default list that is available to all applications, accessible using the class method standardUserDefaults in the NSUserDefaults object. To get [...]
iOS 5 : Look Up Definitions Using Dictionary Service
With iOS 5, there is now a dictionary service that you can access to look up definitions of words. UIReferenceLibraryViewController makes it as easy as creating an instance of the class and providing a term/word to lookup. The view controller will handle the display of the definition and managing the UI (scrolling, etc). // Create [...]
iOS 5 : Twitter Framework – Part 3 – Display List of Twitter Accounts
In the previous two iOS 5 Twitter Framework posts, I covered using TWTweetComposeViewController to display a pre-built controller for posting to Twitter and also wrote an example on how to use the TWRequest object to create an HTTP request to access the Twitter API. Over the past few weeks I’ve had a number of requests [...]
iOS 5 : Twitter Framework – Part 2 – Call Twitter API with TWRequest
In the previous post on iOS 5 and the new Twitter framework, I walked through how to use TWTweetComposeViewController to display a pre-built controller for easily integrating and posting to Twitter. In this post I will show you how to use the TWRequest object to create an HTTP request, and in turn, sending and processing [...]
iOS 5 : Twitter Framework – Part 1 – Compose a Tweet with TWTweetComposeViewController
This is the first post of two on how to work with the new Twitter framework in an iOS 5 app. This post will cover the basics to create and display a dialog for composing a tweet. Part 2 in this series can be found here. The primary controller for working with Twitter in iOS [...]
How to Keep the Screen from Locking
By default, iOS will lock the screen and disable the touch sensor if there are no touch events for a specified period of time. Depending on your application, there may be times that you need to keep the screen from locking. For example, if your application is primarily accelerometer driven (such as a game), there [...]
Using Keychain to Store Username and Password
The keychain services on iOS provide a means to securely store content such as passwords, keys, certificates, etc. Each iOS application has a separate set of keychain items. Beginning with iOS 3.0, it is possible to share keychain items across applications. In this tip, I will demonstrate a starting point for working with the keychain [...]
How to Send an SMS Progammatically
This post shows the basics for sending an SMS message from within an iPhone application. The class you’ll need to use is MFMessageComposeViewController which presents the standard SMS interface for composing and sending messages. As you’ll see in the example that follows, you can also pre-populate the body of the message as well one or [...]
Local Notifications
In this post I’ll show you the basics for working with local notifications, which are notifications generated from the device itself, versus a remote notification (aka push notification) that is sent from a remote server. Local notifications are useful when you need to schedule a reminder or otherwise notify the user of a future event. [...]
Vibrate iPhone or Handy Debugging Trick
I’ve covered playing sounds three times in the past: AVAudioPlayer, Audio Session Services and Silent Mode Switch and Playing Sounds. Even with all the above options, I recently was in need of a simple way (read, with little code) to have an audible cue to know when my app reached a certain point of execution. [...]
Carrier Information: Mobile Network Code (MNC) and Mobile Country Code (MCC)
With the release of iOS 4, Apple introduced two new frameworks for obtaining carrier information. CTCarrier offers information about the cellular provider including the carrier name, Mobile Network Code and Mobile Carrier Code. CTTelephonyNetworkInfo is the channel to access information through CTCarrier, this class also provides an update notifier if you need to detect changes [...]
Create MD5 Hash from NSString, NSData or a File
MD5 (Message-Digest algorithm 5) is a crytographic hash function that is commonly used as a means to verify file integrity. For instance, if you store a file on a server and download the same onto a device, you can compare the server hosted MD5 value to a received copy to verify the file was downloaded [...]
Sleep, Pause or Block a Thread
If you ever need to briefly pause a thread of execution, there are two class methods in NSThread you can use. Although you have to use these methods judiciously, they can be handy in instances where you need to force a delay in order to achieve some desired effect. For example, if you want to [...]
Getting the iPhone User Name
The original tip I wrote (shown below) does retrieve the user name, however, giving its undocumented status as well as the returning a string with punctuation removed, the approach suggested by Pascal in the comment section is much better: [[UIDevice currentDevice] name]; When running this code from my device it returns "John’s iPhone" and when [...]






