Quote:
Originally Posted by landmine
while prinitng i am getting NSRangeException error
|
Means you are accessing elements on an array that don't exist in the array.
If you only have a set number of labels available (in your example 3), you could always just add a conditional
Code:
int numberOfContacts = [myArray count];
if (count > 0) {
...
} else if (count > 1) {
...
} else if (count > 2) {
...
}
or if you dynamically create labels, iterate over all the elements in your array
Code:
for (ContactObject contact in contactArray) {
....
}