Re: -[NSCFArray initWithObjects:count:]: nil object. Why no crash?
Re: -[NSCFArray initWithObjects:count:]: nil object. Why no crash?
- Subject: Re: -[NSCFArray initWithObjects:count:]: nil object. Why no crash?
- From: Ken Thomases <email@hidden>
- Date: Mon, 27 Sep 2010 10:18:50 -0500
On Sep 26, 2010, at 7:51 PM, Jerry Krinock wrote:
> On 2010 Sep 26, at 16:58, Ken Thomases wrote:
>
>> Have you tried actually using the method that's in his log (-initWithObjects:count:), instead of a different one? Or even +arrayWithObjects:count:?
>
> Yes, but to make a long story short, I was stymied by the rocket science of class clusters and abstract classes. The error says that +initWithObjects:count: was sent to NSCFArray. So first I reverse-engineered from savannah.gnu.org what are the argument types. They are id* (a C array of ids), and an unsigned int. Then I constructed an invocation using the NSClassFromString(), @selector(), etc. But upon invoking, the system told me that +initWithObjects:count: is not implemented the *abstract* class NSCFArray. I don't know what the concrete subclass is :(
Just invoke it on an NSArray instance: [[NSArray alloc] initWithObjects:foo count:bar]
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden