Perfect answer. I would like to add one point. Statement [NutArray addObject: SomeData] is wrong. It should be [NutArray addObject:singleNutData].

Please go through the docs of NSArray & its subclasses.

Regards,
Parag

On Jul 2, 2009 8:26am, Roland King <[email protected]> wrote:
1) NSArray doesn't respond to addObject, you need NSMutableArray, where is your declaration of NutArray?



2) you're leaking singleNutData each time you make one (unless you are using Garbage collection or there's a release you're not showing



3) NutArray should really start with a lowercase letter if you're being standard about naming. NutArray would be a class, nutArray is an instance.



Agha Khan wrote:


I am adding a object (somedata)

for (int i = 0; i
{

SomeData* singleNutData = [[SomeData alloc] init];

[NutArray addObject: SomeData];

}



I am getting warning.

NSArray may not respond to -addObject.

(Message without a matching method signature will be assumed to return id and accept '...' as arguments.)



Am I am doing something wrong?

I am new to Apple development and how can I get rid of this message.



Thanks in advance.

Best regards

-Agha

_______________________________________________



Cocoa-dev mailing list ([email protected])



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:

http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org



This email sent to [email protected]


_______________________________________________



Cocoa-dev mailing list ([email protected])



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:

http://lists.apple.com/mailman/options/cocoa-dev/parag.vibhute%40gmail.com



This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to