How to add subgroup to a group in contacts in iPhone apps programmatically?
<p>I am new to this contacts applications in iPhone applications. my requirement is to add groups and sub groups to the groups Programmatically. I have achieved how to add groups to the iPhone default contact database. now I want add sub-groups to the existing groups.</p>

<p>I have tried to add sub-group to the groups by using ABgroup method ABGroupCreateInSource()
my code is like this    </p>

<pre><code>ABRecordRef subGroup = ABGroupCreateInSource(group);
ABRecordSetValue(subGroup, kABGroupNameProperty, groupName, &amp;error);
ABAddressBookAddRecord(contacts, subGroup, &amp;error);
ABAddressBookSave(contacts, &amp;error); 
</code></pre>

<p>but application is crashing by giving exception like "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType length]: unrecognized selector sent to instance 0x158190'"</p>

<p>some body please help me. some help will be really helpful to my application.</p>

<p>Thanks in Advance.</p>
