Issue in Pushing ABPersonViewController - iphone

i am having trouble in pushing ABpersonViewController when the name is from user added then everything works perfectly but when name is from default simulator entries then its not working i will explain in detail in code
-(void)showPersonViewController:(NSString *)name
{
ABAddressBookRef addressBook = ABAddressBookCreate();
NSString *string = name;
NSLog(#"%#",string);
CFStringRef cfstringRef = (CFStringRef)string;
NSArray *peoplee = (NSArray *)ABAddressBookCopyPeopleWithName(addressBook, cfstringRef);
NSLog(#"%#",peoplee);
// 1ST QUESTION when contact is from defalut contact nslog is null but when from user added then it has value I dont understand why this is happening
if ((peoplee != nil) && [peoplee count])
{
ABRecordRef person = (ABRecordRef)[peoplee objectAtIndex:0];
ABPersonViewController *picker = [[ABPersonViewController alloc] init];
picker.personViewDelegate = self;
picker.displayedPerson = person;
picker.allowsEditing = YES;
[self.navigationController pushViewController:picker animated:YES];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Error"
message:#"Could not find Appleseed in the Contacts application"
delegate:nil
cancelButtonTitle:#"Cancel"
otherButtonTitles:nil];
[alert show];
}
CFRelease(addressBook);
}

I replaced your code of converting NSString To CFStringRef :
This is if you are using ARC:
CFStringRef cfstringRef = (__bridge_retained CFStringRef)string;
But it seems you are not, so for Non ARC:
CFStringRef cfstringRef = (CFStringRef)string;
-(void)showPersonViewController
{
ABAddressBookRef addressBook = ABAddressBookCreate();
NSString *string = #"Appleseed";
CFStringRef cfstringRef = (CFStringRef)string;
NSArray *peoplee = (NSArray *)ABAddressBookCopyPeopleWithName(addressBook, cfstringRef);
NSLog(#"%#",peoplee); // does not print null if you have Appleseed as your contact
if ((peoplee != nil) && [peoplee count])
{
ABRecordRef person = (ABRecordRef)[peoplee objectAtIndex:0];
ABPersonViewController *picker = [[ABPersonViewController alloc] init];
picker.personViewDelegate = self;
picker.displayedPerson = person;
// Allow users to edit the person’s information
picker.allowsEditing = YES;
[self.navigationController pushViewController:picker animated:YES];
}
else
{
// Show an alert if "Appleseed" is not in Contacts
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Error"
message:#"Could not find Appleseed in the Contacts application"
delegate:nil
cancelButtonTitle:#"Cancel"
otherButtonTitles:nil];
[alert show];
}
CFRelease(addressBook);
}

Related

How to pase a JSON array in iphone sdk?

I have a login form where the user can login only with the valid memberID and password. If the user enter correct enamel and password i get a result string contains the user information that the user created in the signup process, if it the password is wrong it shows the status 400 as the result string, the result string is the json array which contains one f the above values, one thing is the if the success login occur it gives the staus 200 along with the user information, my need is to retrieve the status message from the array and i need to validate it within the app, if the login success(status 200) it needs to be redirected to the main page; if it is(status 400) it shows a unsuccessful login message.
my code:
EDit
-(IBAction)_clicksbtnsignIN:(id) sender
{
[_txtmemberId resignFirstResponder];
[_txtpassword resignFirstResponder];
NSString *connectionstring = [[NSString alloc]initWithContentsOfURL:[NSURL URLWithString:#"http://www.google.com"]];
if ([connectionstring length]==0) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:#"Error" message:#"you are not connected to the internet" delegate:self cancelButtonTitle:#"ok" otherButtonTitles:nil];
[alert show];
[alert release];
}
else
{
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *emailString = _txtmemberId.text; // storing the entered email in a string.
// Regular expression to checl the email format.
NSString *emailReg = #"[A-Z0-9a-z._%+-]+#[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:#"SELF MATCHES %#", emailReg];
//[pool drain];
if (_txtmemberId.text.length == 0 || _txtpassword.text.length == 0) {
UIAlertView *alertblnk = [[UIAlertView alloc]initWithTitle:#"ALERT" message:#"Fill the required text fields" delegate:self cancelButtonTitle:#"ok" otherButtonTitles:nil];
[alertblnk show];
[alertblnk release];
}
if (([emailTest evaluateWithObject:emailString] != YES) || [emailString isEqualToString:#""])
{
UIAlertView *loginalert = [[UIAlertView alloc] initWithTitle:#" Alert" message:#"Invalid Email ID" delegate:self
cancelButtonTitle:#"OK" otherButtonTitles:nil];
[loginalert show];
[loginalert release];
}
else {
[_spinner startAnimating];
NSString *uname = _txtmemberId.text;
NSString *pwd = _txtpassword.text;
NSString *urlVal = #"http://dev.eltouchapps.net/api/?app=1&type=m1&action=t2&var1=";
NSString *urlVal1 = [urlVal stringByAppendingString:uname];
NSString *urlVal2 = [urlVal1 stringByAppendingString:#"&var2="];
NSString *urlVal3 = [urlVal2 stringByAppendingString:pwd];
NSString * encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)urlVal3,NULL, (CFStringRef)#"\n" "",kCFStringEncodingUTF8 );
NSURL *url = [NSURL URLWithString:encodedString];
NSString *resultString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
UIAlertView *loginalert = [[UIAlertView alloc] initWithTitle:#" Message" message:resultString delegate:self
cancelButtonTitle:#"OK" otherButtonTitles:nil];
[loginalert show];
[loginalert release];
lblresult.text = resultString;
NSString *responseString = [resultString responseString];
NSLog(#"Got Profile: %#", responseString);
NSMutableDictionary *responseJSON = [responseString JSONValue];
NSString *firstName;
if ([[responseJSON valueForKey:#"Status"] isEqualToString:#"200"]) // if success
{
ParallelReadViewController *detailViewController = [[ParallelReadViewController alloc] initWithNibName:#"ParallelReadViewController" bundle:nil];
//detailViewController.firstString = firstString;
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
// do something
firstName = [responseJSON valueForKey:#"FirstName"];
}
}
}
}
Result string is why i get from the server. I know there is parsing of JSONB array we want , but i didn't know how to done this.
Thanks in advance.
based on assumption of your response , try below code
NSString *resultString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
NSMutableDictionary *responseJSON = (NSMutableDictionary *)[responseString JSONValue];
NSString *firstName;
if ([[responseJSON valueForKey:#"Status"] isEqualToString:#"200"]) // if success
{
// do something
firstName = [responseJSON valueForKey:#"FirstName"];
}
Hope it gives you an idea.
Check out this JSON framework: https://github.com/stig/json-framework/

How to edit the existing contacts programmatically in iPhone

I want to edit the contact list programatically.is there any API's available for this.....
-(void)showPersonViewController:(NSString *)nameInContact
{
// Fetch the address book
ABAddressBookRef addressBook = ABAddressBookCreate();
// Search for the person in the address book
NSArray *people = (NSArray *)ABAddressBookCopyPeopleWithName(addressBook, CFSTR(nameInContact));
// Display the information if found in the address book
if ((people != nil) && [people count])
{
ABRecordRef person = (ABRecordRef)[people objectAtIndex:0];
ABPersonViewController *picker = [[[ABPersonViewController alloc] init] autorelease];
picker.personViewDelegate = self;
picker.displayedPerson = person;
// Allow users to edit the person’s information
picker.allowsEditing = YES;
[self.navigationController pushViewController:picker animated:YES];
}
else
{
// Show an alert if the person is not in Contacts
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Error"
message:[NSString stringWithFormat:#"Could not find %# in the Contacts application", nameInContact]
delegate:nil
cancelButtonTitle:#"Cancel"
otherButtonTitles:nil];
[alert show];
[alert release];
}
[people release];
CFRelease(addressBook);
}
You can access the contacts programmatically and edit them using ABAddressBook.framework.
You can find documentation here:
http://developer.apple.com/library/mac/#documentation/userexperience/Reference/AddressBook/Classes/ABAddressBook_Class/Reference/Reference.html
and programming guide here:
http://developer.apple.com/library/ios/#documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Introduction.html

adding all person in form of array in ABRecordRef

how can i add the people from the contacts to 'people'- array then to abrecordref.??? Actually i want all the contacts in tableview and can able to edit individual record. here is my code:
-(void)showPersonViewController
{
// Fetch the address book
ABAddressBookRef addressBook = ABAddressBookCreate();
// Search for the person named "rubal" in the address book
NSArray *people = (NSArray *)ABAddressBookCopyPeopleWithName(addressBook, CFSTR("naina"));
// Display "KETAN" information if found in the address book
if ((people != nil) && [people count])
{
ABRecordRef person = (ABRecordRef)[people objectAtIndex:0];
ABPersonViewController *picker = [[[ABPersonViewController alloc] init] autorelease];
picker.personViewDelegate = self;
picker.displayedPerson = person;
// Allow users to edit the person’s information
picker.allowsEditing = YES;
[self.navigationController pushViewController:picker animated:YES];
}
else
{
// Show an alert if "KETAN" is not in Contacts
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Error"
message:#"Could not find naina in the Contacts application"
delegate:nil
cancelButtonTitle:#"Cancel"
otherButtonTitles:nil];
[alert show];
[alert release];
}
[people release];
CFRelease(addressBook);
}
instead of only 'naina' i want all record in table view and edit individually
Look at ABPerson Class Reference. There is a list of other copy functions, including the one you seek, ABAddressBookCopyArrayOfAllPeople(ABAddressBookRef ab)
comment out your function and add this one and see if it works
-(BOOL)peoplePickerNavigationController:
(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person {
[peoplePicker dismissModalViewControllerAnimated:NO];
ABPersonViewController *picker = [[ABPersonViewController alloc] init];
picker.personViewDelegate = self;
picker.displayedPerson = person;
// Allow users to edit the person’s information
picker.allowsEditing = YES;
[picker setValue:[NSNumber numberWithBool:YES] forKey:#"allowsDeletion"];
[self.navigationController pushViewController:picker animated:YES];
return YES;
}

Sending Email in background in iphone sdk with body

I am developing on app in that i want to send email at the back ground.
for that i used the "SKPSMTP" library but when i got the mail it is without body so can any one tell me where i m wrong in my code.
following is the code on button click..
- (void)sendMessageInBack:(id)anObject
{
if(![self validateEmail:txt_email.text])
{
if([txt_email.text isEqualToString:#""] )
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Mandatory field" message:#"Please fill complete email" delegate:self cancelButtonTitle:#"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
}
else
{
if(self.interfaceOrientation==UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation==UIInterfaceOrientationLandscapeRight )
{
if(rotate)
[btn_Send setImage:[UIImage imageNamed:#"send_button.png"] forState:UIControlStateNormal];
}
else if(self.interfaceOrientation==UIInterfaceOrientationPortrait || self.interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown )
{
if(rotate)
[btn_Send setImage:[UIImage imageNamed:#"send button1.png"] forState:UIControlStateNormal];
}
NSLog(#"Start Sending");
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:#"RequestReview.txt"];
NSData *dataObj = [NSData dataWithContentsOfFile:writableDBPath];
//NSString *mailid;
SKPSMTPMessage *testMsg = [[SKPSMTPMessage alloc] init];
testMsg.fromEmail =#"spymekdemo#gmail.com";
testMsg.toEmail = #"priyanka.chinchmalatpure#gmail.com";// txtEmail.text;
testMsg.relayHost = #"smtp.gmail.com";
testMsg.requiresAuth = YES;
testMsg.login = #"spymekdemo#gmail.com";
testMsg.pass =#"spymek123";
testMsg.subject =#"Sbject"; //[NSString stringWithFormat:#"Reply to Review From %#", txtName.text];
testMsg.wantsSecure = YES; // smtp.gmail.com doesn't work without TLS!
// Only do this for self-signed certs!
testMsg.validateSSLChain = NO;
testMsg.delegate = self;
NSString *deviceIdentifier=[NSString stringWithFormat:#"%#",[[UIDevice currentDevice]uniqueIdentifier]];//[NSString stringWithFormat:#"%#",deviceToken.uniqueIdentifier];
NSLog(#"%#",deviceIdentifier);
//NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:#"text/plain",kSKPSMTPPartContentTypeKey,
// [NSString stringWithFormat:#"Request Review\n\nDevice Identifier=%#\nProduct Name=%#\nProduct Download URL=%#\nUser Name=%#\nEmail=%#\nPromo Code=%#\nDescription Of Product=%#\n\n\n", deviceIdentifier, txtProduct.text,txtDownloadURL.text, txtName.text,txtEmail.text,txtPromocode.text, txtDescription.text]
// ,kSKPSMTPPartMessageKey,#"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
NSDictionary *plainPart = [NSDictionary dictionaryWithObjectsAndKeys:#"text/html",kSKPSMTPPartContentTypeKey,
[NSString stringWithFormat:#"<h2>Request Review</h2><br/><br/><b>Thank you for giving us your review</b> <br/>Device Identifier=%#<br/>Product Name=<br/>Product Download URL=<br/>User Name=<br/>Email=<br/>Promo Code=<br/>Description Of Product=<br/><br/><br/>", deviceIdentifier]
,kSKPSMTPPartMessageKey,#"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
// [NSString stringWithFormat:#"<h3>Review App</h3> <br/> <br/><b>Name=%#<b><br/> <br/>,\n<u>Email=%#</u><br/> <br/>,\nPassword=%#,<br/><br/> <b>\nComments=%#\n\n</b><br/>",txtName.text,txtMailId.text, txtPassword.text, txtComment.text],kSKPSMTPPartMessageKey,#"8bit",kSKPSMTPPartContentTransferEncodingKey,nil];
// #"<html><body><h1>Review App</h1> <br/> <b>Some text to include in body</b></body></html>"
NSDictionary *vcfPart = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:#"text/directory;\r\n\tx-unix-mode=0644;\r\n\tname=\"%#.txt\"",txt_name.text],kSKPSMTPPartContentTypeKey,
[NSString stringWithFormat:#"attachment;\r\n\tfilename=\"%#.txt\"",txt_name.text],kSKPSMTPPartContentDispositionKey,[dataObj encodeBase64ForData],kSKPSMTPPartMessageKey,#"base64",kSKPSMTPPartContentTransferEncodingKey,nil];
testMsg.parts = [NSArray arrayWithObjects:plainPart,vcfPart, nil]; //vcfPart
[testMsg send];
}
}
rotate=YES;
}
- (void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error
{
[message release];
//open an alert with just an OK button
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#"Error" message:#"Unable to send email"
delegate:self cancelButtonTitle:#"OK" otherButtonTitles: nil];
[alert show];
[alert release];
NSLog(#"delegate - error(%d): %#", [error code], [error localizedDescription]);
//[self ClearFile];
//UIAlertView *alert=[[UIAlertView alloc]initWithTitle:#"Request Review" message:#"Review Posting failed.. Try Again Later.." delegate:self cancelButtonTitle:#"Cancel" otherButtonTitles:#"Done",nil];
}
- (void)messageSent:(SKPSMTPMessage *)message
{
[message release];
NSLog(#"delegate - message sent");
}

How to add contact from within an iPhone app?

I am looking to keep track of people in my iPhone app - either adding them from existing contact data, or prompting the user to enter a new contact which will be saved to their Contacts.
I know I can create a persons record add write it to the Contact book, is it possible to display this screen?
Or do I have to implement my own view to facilitate creating a contact entry?
Apple provides ABNewPersonViewController. If you'd like some sample code, see Quick Contacts, in particular, this section:
ABNewPersonViewController *picker = [[ABNewPersonViewController alloc] init];
picker.newPersonViewDelegate = self;
UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:picker];
[self presentModalViewController:navigation animated:YES];
[picker release];
[navigation release];
Have you tried using the ABNewPersonViewController?
See this and look for the section titled "Prompting the User to Create a New Person Record".
Below code can use for all IOS version,
#import ,#import
-(void)addContact
{
ABPeoplePickerNavigationController *peoplePicker;
ABAddressBookRef addressBook;
peoplePicker=[[ABPeoplePickerNavigationController alloc] init];
addressBook = [peoplePicker addressBook];
if(!IOS_OLDER_THAN_6)
{
addressBook = ABAddressBookCreateWithOptions(NULL, NULL);
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined)
{
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error)
{
if (granted)
{
if (![self checkExistsContacts]){
[self addThisContact];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App " message:#"Your contat is already exists." delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App does not access to your contacts" message:#"To enable access go to : iPhone's Settings Privacy > Contacts > App > set 'On'" delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
});
}
else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized)
{
// The user has previously given access, add the contact
if (![self checkExistsContacts]){
[self addThisContact];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App " message:#"Your contat is already exists." delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
}
else
{
// The user has previously denied access
// Send an alert telling user to change privacy setting in settings app
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App does not access to your contacts" message:#"To enable access go to : iPhone's Settings Privacy > Contacts > App > set 'On'" delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
}
else
{
if (![self checkExistsContacts]){
[SVProgressHUD showWithStatus:#"Saving..." maskType:SVProgressHUDMaskTypeClear];
NSString *strCell=#"1-800-123-1234”;
NSString *strFirstName=#“fname”;
NSString *strLastName=#“lname”;
NSUInteger addressbookId = 0;
ABRecordRef aRecord = ABPersonCreate();
CFErrorRef anError = NULL;
ABRecordSetValue(aRecord, kABPersonFirstNameProperty, (__bridge CFTypeRef)(strFirstName), &anError);
ABRecordSetValue(aRecord, kABPersonLastNameProperty, (__bridge CFTypeRef)(strLastName), &anError);
//(#"adding phonee");
ABMutableMultiValueRef multi = ABMultiValueCreateMutable(kABMultiStringPropertyType);
if(strCell) ABMultiValueAddValueAndLabel(multi, (__bridge CFTypeRef)(strCell), kABPersonPhoneIPhoneLabel,NULL);
CFRelease(multi);
ABAddressBookRef addressBook1;
CFErrorRef error = NULL;
addressBook1 = ABAddressBookCreate();
ABAddressBookAddRecord (addressBook1, aRecord, &error);
if (error != NULL) {
}
error = NULL;
if(ABAddressBookSave ( addressBook1, &error)){
addressbookId = ABRecordGetRecordID (aRecord);
}
if (error != NULL) {
}
CFRelease(aRecord);
CFRelease(addressBook1);
[SVProgressHUD dismiss];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App” message:#"Contact saved successfully." delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil, nil];
[alert show];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App " message:#"Your contat is already exists." delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
}
}
- (void)addThisContact
{
[SVProgressHUD showWithStatus:#"Saving..." maskType:SVProgressHUDMaskTypeClear];
NSString *strCell=#"1-800-123-1234”;
NSString *strFirstName=#“fname”;
NSString *strLastName=#“lname”;
ABRecordRef person = ABPersonCreate();
// set name and other string values
CFErrorRef cfError=nil;
if (strFirstName) {
ABRecordSetValue(person, kABPersonFirstNameProperty, (__bridge CFTypeRef)(strFirstName) , nil);
}
if (strLastName) {
ABRecordSetValue(person, kABPersonLastNameProperty, (__bridge CFTypeRef)(strLastName) , nil);
}
ABMutableMultiValueRef phoneNumberMultiValue = ABMultiValueCreateMutable(kABMultiStringPropertyType);
if (strCell)
{
ABMultiValueAddValueAndLabel(phoneNumberMultiValue, (__bridge CFTypeRef)(strCell), (CFStringRef)#"iPhone", NULL);
}
ABRecordSetValue(person, kABPersonPhoneProperty, phoneNumberMultiValue, nil);
CFRelease(phoneNumberMultiValue);
//Add person Object to addressbook Object.
ABAddressBookAddRecord(addressBook, person, &cfError);
if (ABAddressBookSave(addressBook, nil))
{
NSLog(#"\nPerson Saved successfuly");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App” message:#"Contact saved successfully." delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil, nil];
[alert show];
}
else
{
NSLog(#"\n Error Saving person to AddressBook");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:#“App” message:#"Contact details are not available." delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil, nil];
[alert show];
}
[SVProgressHUD dismiss];
}
- (BOOL)checkExistsContacts
{
NSString *strFirstName=#“fname”;
NSString *strLastName=#“lname”;
CFErrorRef err;
ABAddressBookRef adbk = ABAddressBookCreateWithOptions(addressBook,&err);
ABRecordRef moi = NULL;
CFArrayRef matts = ABAddressBookCopyPeopleWithName(adbk, (__bridge CFStringRef)strFirstName);
// might be multiple matts, but let's find the one with last name Neuburg
for (CFIndex ix = 0; ix < CFArrayGetCount(matts); ix++)
{
ABRecordRef matt = CFArrayGetValueAtIndex(matts, ix);
CFStringRef last = ABRecordCopyValue(matt, kABPersonLastNameProperty);
if (last && CFStringCompare(last, (CFStringRef)strLastName, 0) == 0)
moi = matt;
if (last)
CFRelease(last);
}
if (NULL == moi)
{
NSLog(#"Couldn't find myself");
CFRelease(matts);
CFRelease(adbk);
return NO;
}
else
{
NSLog(#"number already exists");
return YES;
}
return NO;
}