|
|
#1 |
|
NSArray may not respond to '-length'
Not exactly what I am doing wrong here but I create an array of dictionaries from a .plist file and it appears to all work perfectly. I can access the files in it without any issues but when I try to call [array length] I get two warnings.
'NSArray' may not respond to '-length' 'Comparison between pointer and integer' I cant tell what I am doing wrong here as I have called length a million times before. I am calling 'length' in a for loop, plugging the exact number by hand works but it will not always work since I can't know the size of the array in advance. Heres my code for initializing the array and the start of the for loop. Can someone please explain what I got wrong? Code:
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString: @"http://web.suffieldacademy.org/~12clm/data.plist"]];
NSArray *people = [dictionary valueForKey:@"People"];
AppDelegate_Shared *appDelegate =
[[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [appDelegate managedObjectContext];
NSError *error;
//ISSUE HAPPENS HERE!!!!
for (int i = 0;i<[people length]; i++) {
__________________
17'' Unibody MBP 4 GB RAM 500 GB HD, 20'' iMac 2 GB RAM 250 GB HD, 16gb black iPhone 3g, 32gb black iPhone 3GS, 2 TB Time Capsule, 160 GB Apple TV, 32gb iPad 3g, Coming launch day: 32gb iPhone 4 |
|
|
|
0
|
|
|
#2 |
|
It's not length. It's count. Make sure you read the sdk documentation, it would have quickly answered this.
__________________
Mooooooooooooo
|
|
|
|
0
|
|
|
#3 |
|
...woops, sorry I have spent to much time on Java recently, when I looked through the documentation I read count but it never occurred to me that I mixed the two up.
__________________
17'' Unibody MBP 4 GB RAM 500 GB HD, 20'' iMac 2 GB RAM 250 GB HD, 16gb black iPhone 3g, 32gb black iPhone 3GS, 2 TB Time Capsule, 160 GB Apple TV, 32gb iPad 3g, Coming launch day: 32gb iPhone 4 |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Resolved: IApplication may not respond to '+mainWindow' | webznz | iPhone/iPad Programming | 2 | Apr 18, 2011 06:14 PM |
| warning: 'NSOpenGLView' may not respond to | dbrayford | Mac Programming | 1 | Jan 28, 2011 03:11 PM |
| Warning: UIView may not respond to '-view' | AbhishekApple | iPhone/iPad Programming | 1 | Dec 8, 2010 12:57 PM |
| `NSString may not respond to '-getItem'` -- How can I avoid this warning? (appscript) | Warhaven | Mac Programming | 0 | Mar 5, 2010 01:14 PM |
| warning balloons- warning: 'XXXViewController' may not respond to XXX | mlecho | iPhone/iPad Programming | 8 | Dec 24, 2009 05:32 PM |
All times are GMT -5. The time now is 08:26 PM.









Mooooooooooooo
Linear Mode

