Posts

Showing posts from March 24, 2013

Search the content of a UITableView in iphone?

Image
Step 1:   Create a Window base application using template . Give the application name “SearchTable”. 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:   Now we’ll add UITableViewController class and NSObject class to the project. Choose New file -> Select cocoa touch classes group and then selectUITableViewController and NSObject . Give the name of the class MainView and Product. Create a MainView.xib file in the resource folder. Step 4:   In the AppDelegate.h file  we have added UINavigationController in the file. So make the following changes in the file. @interface   SearchTableAppDelegate  :  NSObject    <UIApplicationDelegate>   {    UIWindow  * window;    UINavigationController        * navController; }     @property   ( nonatomic, retain )   IBOutlet UIWindow  * window;     @property   ( nonatomic, retain )   IBOutlet

How to change Language in iPhone?

Image
In this example we will see how to change the language in the iPhone using .xib file. If we change the language into the French from the settings of iPhone, then run the application it will translate the text into the French language. So let see how it will be worked. Step 1 : Create a View base application using template. Give the application name “LanguageChange”. 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:   Expand classes and notice Interface Builder created the LanguageChangeViewController class for you. Expand Resources and notice the template generated a separate nib, LanguageChangeViewController.xib, for the “LanguageChange”. Step 4:   In the LanguageChangeAppDelegate.. file make the following changes in the file: -  ( void ) applicationDidFinishLaunching : ( UIApplication  * ) application   {   UINavigationController  *

What is atomic and nonatomic in iPhone SDk?

The last two are identical; "atomic" is the default behavior (note that it is not actually a keyword; it is specified only by the absence of nonatomic ). Assuming that you are @synthesizing the method implementations, atomic vs. non-atomic changes the generated code. If you are writing your own setter/getters, atomic/nonatomic/retain/assign/copy are merely advisory. With "atomic", the synthesized setter/getter will ensure that a whole value is always returned from the getter or set by the setter, regardless of setter activity on any other thread. That is, if thread A is in the middle of the getter while thread B calls the setter, an actual viable value -- an autoreleased object, most likely -- will be returned to the caller in A. In nonatomic , no such guarantees are made. Thus, nonatomic is considerably faster than "atomic". What "atomic" does not do is make any guarantees about thread safety. If thread A is calling the getter s

UITextFieldDelegate in iphone sdk

- ( void )viewWillAppear:( BOOL )animated {   [ super viewWillAppear :animated];   [[ NSNotificationCenter defaultCenter ] addObserver : self selector : @selector ( keyboardWillShow :)                name : UIKeyboardWillShowNotification object : self . view . window ];   [[ NSNotificationCenter defaultCenter ] addObserver : self selector : @selector ( keyboardWillHide :)                name : UIKeyboardWillHideNotification object : self . view . window ]; } - ( void )viewWillDisappear:( BOOL )animated{  [ self setEditing : NO animated : YES ];   // unregister for keyboard notifications while not visible.  [[ NSNotificationCenter defaultCenter ] removeObserver : self name : UIKeyboardWillShowNotification object : nil ];  [[ NSNotificationCenter defaultCenter ] removeObserver : self name : UIKeyboardWillHideNotification object : nil ]; } #pragma mark - UIViewController delegate methods - ( void ) keyboardWillShow:( NSNotificati

how To Add sound in iphone/ipad ?

first add Frameworks (AVFoundation.framework) and import: #import <AVFoundation/AVFoundation.h> - ( void )viewDidLoad {     [ super viewDidLoad ]; NSURL *url = [ NSURL fileURLWithPath :[ NSString stringWithFormat : @"%@/Sound.mp3" , [[ NSBundle mainBundle ] resourcePath ]]];    AVAudioPlayer *audioPlayer = [[ AVAudioPlayer alloc ] initWithContentsOfURL :url error : nil ];    audioPlayer. numberOfLoops = 0 ;    [audioPlayer play ]; }

iOS 6.X SDK release history

                                        Table of versions: iOS 6.x SDK Version Release date Xcode version iOS 6.0 beta 1 June 11, 2012 Xcode 4.5 Beta preview iOS 6.0 beta 2 June 25, 2012 Xcode 4.5 Beta 2 preview iOS 6.0 beta 3 July 16, 2012 Xcode 4.5 Beta 3 preview iOS 6.0 beta 4 August 6, 2012 Xcode 4.5 Developer Preview iOS 6.0 Golden Master September 12, 2012 Xcode 4.5 Golden Master iOS 6.0 Final September 19, 2012 Xcode 4.5 iOS 6.1 beta 1 November 1, 2012 Xcode 4.6 iOS 6.1 beta 2 November 12, 2012 Xcode 4.6 iOS 6.1 beta 3 December 3, 2012 Xcode 4.6 iOS 6.1 beta 4 December17,2012 Xcode 4.6 iOS 6.1 January 26, 2013 X