Tuesday, October 30, 2012

How to create radio button in iPhone

key word: Radio button, iphone,ios,view,custome control

How to create radio button in iPhone

Get contacts of all your emergency needs on single tap. Download Quick-Finder for iPhone

Go to the following link to get the sample code of radio button  

http://www.mediafire.com/download/52djc91c5ni2a4k/RadioButton.zip

Sunday, October 28, 2012

How to make web address, mail id and phone number as a hyper link

Get contacts of all your emergency needs on single tap. Download Quick-Finder for iPhone

Problem Statement- want to make phone number and mail id as a hyper link so that user can make call and can mail directly on clicking the number


Solution:

1) For this you have to take textview as label does not support it
2) Take a text view.
3) Set text of text view by method

[self.testTextView set Text: @"http://www.google.com                test@test.com        1234567890"];


4) Now you have to make text view able to detect web address and mail id for that use following code

[self.testTextView setDataDetectorTypes:UIDataDetectorTypeAddress];
[self.testTextView setDataDetectorTypes:UIDataDetectorTypeLink];
[self.testTextView setDataDetectorTypes:UIDataDetectorTypePhoneNumber];

You can use 

[self.testTextView setDataDetectorTypes:UIDataDetectorTypeAll];

Instead of the above three line of code.

Now your code is prepare to run.

When you run the code you will get the screen like:







long press on the phone number or mail id , you will get the respective action.



Friday, October 26, 2012

How to restrict user to enter character in phone text field


How to restrict user to enter character in phone text field

Get contacts of all your emergency needs on single tap. Download Quick-Finder for iPhone

 1) Take a text field let its name is phoneTextField.


2) attach delegate of phoneTextField to FileOwner.
                          Or
    you can do it by code as


self. phoneTextField.delegate=self;

3) implement the delegate UITextFieldDelegate in .h file.

4) Put a macro before @implementation  


    #define NUMERIC                 @"1234567890"

5) implement the following method as:


- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
NSCharacterSet *unacceptedInput = nil;
if(textField== self. phoneTextField)
{
unacceptedInput = [[NSCharacterSet characterSetWithCharactersInString:NUMERIC] invertedSet];
}
return ([[string componentsSeparatedByCharactersInSet:unacceptedInput] count] <= 1);}





Wednesday, October 24, 2012

consuming soap web services in ios






  Consuming soap web services in ios

Get contacts of all your emergency needs on single tap. Download Quick-Finder for iPhone

Use the following link to generate helping code to consume web services

http://adf.ly/Dzf4b

This link open website of sudzC which provide free generated code to consume SOAP web service. To know how to consume generated code download the following HTML file.

http://adf.ly/Dzg6V

2) How to implement google search in ios App


Take a webview and create outlet of that . Let its name is googleWebView.


Take a text field in which you want that user put his key word to search and also make its outlet . Let its name is googleTextField.


Take a button on which you want to start the search create its outlet and action . Let action is doSearch


write the following code under section

-(IBAction)doSearch:(id)sender

{

[self. googleWebView loadRequest: [NSURLRequest requestWithURL:[NSString stringWithFormat:@"http://www.google.com/search?q=%@",self.googleTextField]]];

}

This will open google search page with key word what you enter in text field



You can also download text file from here 

http://adf.ly/E3Cda