NSString *const kDenied=@"Adres defterine : Notes">

NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

//
// AppDelegate.m
// InsertingaPersonintoAddressBook
//
// Created by STU 29 on 22.04.2016.
// Copyright (c) 2016 Fatih. All rights reserved.
//

#import "AppDelegate.h"
#import <AddressBook/AddressBook.h>

NSString *const kDenied=@"Adres defterine erişim engellendi.";
NSString *const kRestricted=@"Adres defterine erişim kısıtlandı";

ABAddressBookRef addressBook;

@interface AppDelegate ()

@end

@implementation AppDelegate

-(void) displayMessage:(NSString *) paramMessage{
[[[UIAlertView alloc] initWithTitle:nil
message:nil
delegate:@"Ok"
cancelButtonTitle:nil
otherButtonTitles:nil, nil]show];
}

-(ABRecordRef) newPersonWithFirstName:(NSString *)paramFirstName lastname:(NSString *)paramLastName inAddressBook:(ABAddressBookRef)paramAddressBook{

ABRecordRef result=NULL;
if (paramAddressBook==NULL) {
NSLog(@"The Address Book is NULL.");
return NULL;
}

if ([paramFirstName length==0 &&paramLastName lenght==0]) {
NSLog(@"Firs name and last name are both empty...");
return NULL;
}

result=ABPersonCreate();
if (result==NULL) {
NSLog(@"Failed to create a new person...");
return NULL;
}

BOOL couldSetFirstName=NO;
BOOL couldSetLastName=NO;
CFErrorRef setFirstNameError=NULL;
CFErrorRef setLastNameError=NULL;

couldSetFirstName=ABRecordSetValue(result, kABPersonFirstNameProperty, (__bridge CFTypeRef)paramFirstName, &setFirstNameError);

couldSetLastName=ABRecordSetValue(result, kABPersonLastNameProperty, (__bridge CFTypeRef)paramLastName, &setLastNameError);

CFErrorRef couldAddPersonError=NULL;

BOOL couldAddPerson=ABAddressBookAddRecord(paramAddressBook, result, &couldAddPersonError);
if (couldAddPersonError) {
NSLog(@"Successfully aded the person");
}
else{
NSLog(@"Failed");
CFRelease(result);
result=NULL;
return result;
}
if (ABAddressBookHasUnsavedChanges(paramAddressBook)) {
CFErrorRef couldSaveAddressBookError=NULL;
BOOL couldSaveAdressBook=ABAddressBookSave(paramAddressBook, &couldSaveAddressBookError);
if (couldSaveAdressBook) {
NSLog(@"successfully saved the address book.");
}
else{
NSLog(@"Failed");
}
}

}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.