Re: NSMutableArray count causes EXC_BAD_ACCESS
Re: NSMutableArray count causes EXC_BAD_ACCESS
- Subject: Re: NSMutableArray count causes EXC_BAD_ACCESS
- From: Mark Woollard <email@hidden>
- Date: Sun, 15 Aug 2010 19:00:44 -0400
[members count] returns an integer, not a class instance, so you need to use:
NSLog(@"Count: %d",[members count]);
Mark
On 15 Aug 2010, at 18:12, Andrew Gehring wrote:
> I'm new to XCode /Obj-c, so please forgive my my transgressions...
>
> I have 'NSMutableArray *members;'
>
> I load the array with XML data:
>
> members = [[NSMutableArray alloc] init];
> NSArray *memberElements = [doc nodesForXPath:@"//member/value/string"
> error:&error];
> for (NSXMLElement *xmlElement in memberElements)
> [members addObject:[xmlElement stringValue]];
>
> I can "Log" the array, and it contains the expected data:
>
> NSLog(@"Members: %@", members);
>
> But when I try to count, I get a EXC_BAD_ACCESS
>
> NSLog(@"Count: %@", [members count]);
>
>
> Any help would be appreciated.
>
> Andrew
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden