小编Dev*_*Dev的帖子

将多个userInfo存储在本地通知中

我正在创建一个UILocalNotification,我需要为此设置多个userInfo,我该怎么做?

    // Create a new notification

    UIApplication* app = [UIApplication sharedApplication];

    UILocalNotification *alarm = [[UILocalNotification alloc] init];

    alarm.fireDate = date;        
    alarm.timeZone = [NSTimeZone localTimeZone];
    alarm.alertBody = msg;        
    alarm.alertAction = @"View";            
    alarm.repeatInterval = NSYearCalendarUnit;
    alarm.soundName=@"happyBirthday.wav";
    alarm.applicationIconBadgeNumber = 1;    

   NSDictionary *userDict = [NSDictionary dictionaryWithObject:detailperson forKey:@"msg"];
   NSDictionary *userDictName = [NSDictionary dictionaryWithObject:detailperson2 forKey:@"name"];

   alarm.userInfo = userDict;
   alarm.userInfo = userDictName;
Run Code Online (Sandbox Code Playgroud)

iphone uilocalnotification

3
推荐指数
1
解决办法
3237
查看次数

如何在iphone中编辑地址簿中的联系人?

我创建了一个新的application.i添加地址簿中的联系人,请参阅下面的代码,但如何编辑这个添加联系人从地址簿,我不知道.

任何人都知道然后给出样本代码或想法.

thanx提前给我宝贵的时间.

//code for add contact in contact list 

ABRecordRef aRecord = ABPersonCreate(); 
CFErrorRef  anError = NULL; 
ABRecordSetValue(aRecord, kABPersonFirstNameProperty, 
                 txtfirstname.text, &anError); 
ABRecordSetValue(aRecord, kABPersonLastNameProperty, 
                 txtlastName.text, &anError); 
ABRecordSetValue(aRecord, kABPersonBirthdayProperty, 
                 [datepick date], &anError); 
ABRecordSetValue(aRecord, kABPersonPhoneProperty, 
                 txtMobileNo, &anError); 
ABRecordSetValue(aRecord, kABPersonEmailProperty, 
                 txtEmailID, &anError); 
if (anError != NULL) 
{ 
    NSLog(@"error while creating..");
} 
CFStringRef firstName, lastName,birthDay; 
firstName = ABRecordCopyValue(aRecord, kABPersonFirstNameProperty); 
lastName  = ABRecordCopyValue(aRecord, kABPersonLastNameProperty); 
birthDay  = ABRecordCopyValue(aRecord, kABPersonBirthdayProperty); 

ABMutableMultiValueRef email = ABMultiValueCreateMutable(kABMultiStringPropertyType);
ABMultiValueAddValueAndLabel(email, txtEmailID.text, CFSTR("email"), NULL);
ABRecordSetValue(aRecord, kABPersonEmailProperty, email, &anError);
CFRelease(email);

ABMutableMultiValueRef multiPhone =  ABMultiValueCreateMutable(kABMultiStringPropertyType); …
Run Code Online (Sandbox Code Playgroud)

iphone abaddressbook

2
推荐指数
1
解决办法
2129
查看次数