Post

Replies

Boosts

Views

Activity

Parsing preferred phonenumbers with CNPhoneNumber from vcf-file
I try to parse a vcf-file. I use CNContact for this. That works quite well, but with the phonenumbers i have a problem. With CNLabeledValue<CNPhoneNumber*>* I get the label (e. g. "home") and the phonenumber in the value. Excerpt from the vCard: TEL;TYPE=home:1234567890 But if the number is tagged with a "pref" i can't get this tag for the phonenumber. Excerpt from the vCard: TEL;TYPE=home,pref:0987654321 Is there anyway to find out, which numbers are the preferred numbers? I use following code: for (CNLabeledValue<CNPhoneNumber*>* number in cnContact.phoneNumbers) { NSString *label = number.label; NSString *number = ((CNPhoneNumber*)number).stringValue; //Do some work with label and number }
0
0
759
Jan ’23
Crash from NSMutableDictionary
I have a crashlog from a customer and can't find out what's the problem. The exception backtrace shows follows: 1 libobjc.A.dylib 0x1cf6a6734 objc_exception_throw + 60 2 CoreFoundation 0x1b6b4c5d0 -[__NSCFString characterAtIndex:].cold.1 + 0 3 CoreFoundation 0x1b6b57858 -[__NSDictionaryM setObject:forKey:].cold.2 + 0 4 CoreFoundation 0x1b69f70dc -[__NSDictionaryM setObject:forKey:] + 896 5 MyApp 0x102995c94 -[ListUITableViewController setImageCell:forbox:forAccount:] + 1612948 (ListUITableViewController.m:305) In line 305 of setImageCell method I add a NSMutableArray to a NSMutableDictionary: [self.name2NameCells setValue:nameCells forKey:name.lowercaseString]; Before that the required nil-checks are done. Any ideas?
5
0
1.5k
May ’22
Parsing preferred phonenumbers with CNPhoneNumber from vcf-file
I try to parse a vcf-file. I use CNContact for this. That works quite well, but with the phonenumbers i have a problem. With CNLabeledValue<CNPhoneNumber*>* I get the label (e. g. "home") and the phonenumber in the value. Excerpt from the vCard: TEL;TYPE=home:1234567890 But if the number is tagged with a "pref" i can't get this tag for the phonenumber. Excerpt from the vCard: TEL;TYPE=home,pref:0987654321 Is there anyway to find out, which numbers are the preferred numbers? I use following code: for (CNLabeledValue<CNPhoneNumber*>* number in cnContact.phoneNumbers) { NSString *label = number.label; NSString *number = ((CNPhoneNumber*)number).stringValue; //Do some work with label and number }
Replies
0
Boosts
0
Views
759
Activity
Jan ’23
Crash from NSMutableDictionary
I have a crashlog from a customer and can't find out what's the problem. The exception backtrace shows follows: 1 libobjc.A.dylib 0x1cf6a6734 objc_exception_throw + 60 2 CoreFoundation 0x1b6b4c5d0 -[__NSCFString characterAtIndex:].cold.1 + 0 3 CoreFoundation 0x1b6b57858 -[__NSDictionaryM setObject:forKey:].cold.2 + 0 4 CoreFoundation 0x1b69f70dc -[__NSDictionaryM setObject:forKey:] + 896 5 MyApp 0x102995c94 -[ListUITableViewController setImageCell:forbox:forAccount:] + 1612948 (ListUITableViewController.m:305) In line 305 of setImageCell method I add a NSMutableArray to a NSMutableDictionary: [self.name2NameCells setValue:nameCells forKey:name.lowercaseString]; Before that the required nil-checks are done. Any ideas?
Replies
5
Boosts
0
Views
1.5k
Activity
May ’22