iphone - How to put my address book data into UITextField -


<पूर्व> ABAddressBookRef _addressBookRef = ABAddressBookCreate (); NSArray * सभी लोग = (NSArray *) ABAddressBookCopyArrayOfAllPeople (_addressBookRef); NSMutableArray * _allItems = [[NSMutableArray alloc] initWithCapacity: [सभी लोग गणना]]; // क्षमता केवल एक अनुमान लगा है, लेकिन सभी के लिए कुछ भी नहीं है (सभी लोगों में आईडी रिकॉर्ड) {CFTypeRef phoneProperty = ABRecordCopyValue ((ABRecordRef) रिकॉर्ड, KABPersonPhoneProperty); NSArray * फोन = (एनएसएआरआरए *) एबीएमल्टी वैल्यूएपीआरएओएफ़एवलएवल्यूज़ (फोनप्रोपेर्टी); CFRelease (phoneProperty); (NSString * फोन में फोन) {NSString * compositeName = (NSString *) ABRecordCopyCompositeName ((ABRecordRef) रिकॉर्ड); NSString * field = [NSString stringWithFormat @ "% @:% @", कम्पोजिटनाम, फोन]; [कम्पोजिटनाम रिलीज]; [_ऑल वस्तुऐं addObject: field]; } [फोन रिलीज]; } CFRelease (_addressBookRef); [सभी लोगों को जारी]; सभी लोग = शून्य;

मेरे कोड अब मुझे आयात करने के लिए सहायता की आवश्यकता है & amp; amp;

इस कोड के रूप में मैं कैसे मेरी UITextView सेट करूँगा

_allItems एरे में नाम और फोन नंबर डालता है, जिसे आप बाद में एक पाठदृश्य को इस प्रकार से भरने के लिए उपयोग कर सकते हैं:

  के लिए (NSString * txt in _allItems) {mytextview.text = [Mytextview.text स्ट्रिंगबैपिंगफ़ॉर्मेट: @ "% @ \ n", txt]; }  

मान लें कि आपके पास UITextView को नामित mytextview है।


Comments