Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSMutableArray newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray newbie question



On May 23, 2007, at 10:51 AM, Mike Manzano wrote:
On May 23, 2007, at 10:34 AM, julien ricard wrote:
hi,

I've got 2 questions about NSMutableArray:

-how can I create a NSMutableArray initialized with (float) 0s
(without adding them 1 by 1)?

I don't think there's a shortcut to this.

An NSMutableArray cannot directly store float values. They need to be boxed into an NSNumber via +numberWithFloat:.


-after creating a NSMutableArray using NSMutableArray
*myArray=[[NSMutableArray alloc] initWithCapacity:100];, how can I set
the ith value?

- (void)insertObject:(id)anObject atIndex:(unsigned)index

Only if the array already has objects from 0 to index. NSArray/ NSMutableArray does not support "holes" in the array.


b.bum
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSMutableArray newbie question (From: "julien ricard" <email@hidden>)
 >Re: NSMutableArray newbie question (From: Mike Manzano <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.