mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
implement missing method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31984 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d136fc4986
commit
1c3cad8be8
3 changed files with 38 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2011-02-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSPointerArray.m: ([-allObjects]) implement missing method.
|
||||
|
||||
2011-01-29 Stefan Bidigaray <stefanbidi@gmail.com>
|
||||
|
||||
* Source/NSCalendar.m: Handle current calendar updates.
|
||||
|
|
|
@ -63,7 +63,7 @@ extern "C" {
|
|||
*/
|
||||
- (NSUInteger) count;
|
||||
|
||||
/** Initialises the receiver with the spefieifd options.
|
||||
/** Initialises the receiver with the specified options.
|
||||
*/
|
||||
- (id) initWithOptions: (NSPointerFunctionsOptions)options;
|
||||
|
||||
|
|
|
@ -233,6 +233,39 @@ static Class concreteClass = Nil;
|
|||
[exception raise];
|
||||
}
|
||||
|
||||
- (NSArray*) allObjects
|
||||
{
|
||||
NSUInteger i;
|
||||
NSUInteger c = 0;
|
||||
|
||||
for (i = 0; i < _count; i++)
|
||||
{
|
||||
if (_contents[i] != 0)
|
||||
{
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == c)
|
||||
{
|
||||
return [NSArray array];
|
||||
}
|
||||
else
|
||||
{
|
||||
GSMutableArray *a = [GSMutableArray arrayWithCapacity: c];
|
||||
|
||||
for (i = 0; i < _count; i++)
|
||||
{
|
||||
if (_contents[i] != 0)
|
||||
{
|
||||
[a addObject: (id)_contents[i]];
|
||||
}
|
||||
}
|
||||
[a makeImmutableCopyOnFail: NO];
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) compact
|
||||
{
|
||||
NSUInteger i = _count;
|
||||
|
|
Loading…
Reference in a new issue