Skip to content

Commit bf032ab

Browse files
committed
Conflicts: .DS_Store
2 parents 81a381d + 61b9918 commit bf032ab

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

M13OrderedDictionary.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@
141141
@param indices The indices to retreive the entries from.
142142
@return The dictionary containing the entries at the given index set.*/
143143
- (NSDictionary *)unorderedEntriesAtIndices:(NSIndexSet *)indices;
144+
/**The dictionary containing all entries and all objects
145+
@return The dictionary containing all entries and all objects*/
146+
- (NSDictionary *)unorderedDictionary;
144147

145148
/**The ordered array of all keys in the ordered dictionary.
146149
@return The ordered array of all keys in the ordered dictionary.*/
@@ -325,10 +328,10 @@
325328
@return The keys of the passing objects.*/
326329
- (NSArray *)keysOfObjectsAtIndices:(NSIndexSet *)indexSet options:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate;
327330

328-
/**@name Preforming Selectors*/
331+
/**@name Performing Selectors*/
329332
/**Sends to each object in the orderedDictionary the message identified by a given selector, starting with the first object and continuing through the array to the last object.
330333
@param aSelector The selector to make the objects perform.*/
331-
- (void)makeObjectsPreformSelector:(SEL)aSelector;
334+
- (void)makeObjectsPerformSelector:(SEL)aSelector;
332335

333336
/**Sends the aSelector message to each object in the orderedDictionary, starting with the first object and continuing through the array to the last object.
334337
@param aSelector The selector to perform.

M13OrderedDictionary.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ - (NSDictionary *)unorderedEntriesAtIndices:(NSIndexSet *)indexes
188188
return [NSDictionary dictionaryWithObjects:[objects objectsAtIndexes:indexes] forKeys:[keys objectsAtIndexes:indexes]];
189189
}
190190

191+
- (NSDictionary *)unorderedDictionary
192+
{
193+
return [NSDictionary dictionaryWithObjects:objects forKeys:keys];
194+
}
195+
191196
- (NSArray *)allKeys
192197
{
193198
return keys;
@@ -415,9 +420,9 @@ - (NSArray *)keysOfObjectsAtIndices:(NSIndexSet *)indexSet options:(NSEnumeratio
415420
return [keys objectsAtIndexes:[objects indexesOfObjectsAtIndexes:indexSet options:opts passingTest:predicate]];
416421
}
417422

418-
#pragma mark - Preforming Selectors
423+
#pragma mark - Performing Selectors
419424

420-
- (void)makeObjectsPreformSelector:(SEL)aSelector
425+
- (void)makeObjectsPerformSelector:(SEL)aSelector
421426
{
422427
[objects makeObjectsPerformSelector:aSelector];
423428
}
@@ -920,18 +925,13 @@ - (void)addEntriesFromDictionary:(NSDictionary *)dictionary
920925

921926
- (void)insertObject:(id)object pairedWithKey:(id<NSCopying>)key atIndex:(NSUInteger)index
922927
{
923-
NSInteger idx = 0;
924928
if ([pairs objectForKey:key] != nil) {
925-
if (index < [self indexOfKey:key]) {
926-
idx = index - 1;
927-
} else {
928-
idx = index;
929-
}
930929
[self removeEntryWithKey:key];
931930
}
931+
932932
[pairs setObject:object forKey:key];
933-
[keys insertObject:key atIndex:idx];
934-
[objects insertObject:object atIndex:idx];
933+
[keys insertObject:key atIndex:index];
934+
[objects insertObject:object atIndex:index];
935935
}
936936

937937
- (void)insertEntry:(NSDictionary *)entry atIndex:(NSUInteger)index

M13OrderedDictionary.xcodeproj/project.xcworkspace/xcshareddata/M13OrderedDictionary.xccheckout

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@
55
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
66
<false/>
77
<key>IDESourceControlProjectIdentifier</key>
8-
<string>87933A7B-DEEA-45D2-A9C9-ECFD42622B81</string>
8+
<string>A2290859-C43C-433C-B549-1EE23115D3CB</string>
99
<key>IDESourceControlProjectName</key>
1010
<string>M13OrderedDictionary</string>
1111
<key>IDESourceControlProjectOriginsDictionary</key>
1212
<dict>
13-
<key>2A58D87D-0C3D-4E3E-B996-44464EA9164D</key>
14-
<string>https://github.com/Marxon13/M13OrderedDictionary.git</string>
13+
<key>5CBA84AC-2517-437E-8596-079CE4775AC9</key>
14+
<string>https://github.com/mattquiros/M13OrderedDictionary.git</string>
1515
</dict>
1616
<key>IDESourceControlProjectPath</key>
1717
<string>M13OrderedDictionary.xcodeproj/project.xcworkspace</string>
1818
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
1919
<dict>
20-
<key>2A58D87D-0C3D-4E3E-B996-44464EA9164D</key>
20+
<key>5CBA84AC-2517-437E-8596-079CE4775AC9</key>
2121
<string>../..</string>
2222
</dict>
2323
<key>IDESourceControlProjectURL</key>
24-
<string>https://github.com/Marxon13/M13OrderedDictionary.git</string>
24+
<string>https://github.com/mattquiros/M13OrderedDictionary.git</string>
2525
<key>IDESourceControlProjectVersion</key>
2626
<integer>110</integer>
2727
<key>IDESourceControlProjectWCCIdentifier</key>
28-
<string>2A58D87D-0C3D-4E3E-B996-44464EA9164D</string>
28+
<string>5CBA84AC-2517-437E-8596-079CE4775AC9</string>
2929
<key>IDESourceControlProjectWCConfigurations</key>
3030
<array>
3131
<dict>
3232
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
3333
<string>public.vcs.git</string>
3434
<key>IDESourceControlWCCIdentifierKey</key>
35-
<string>2A58D87D-0C3D-4E3E-B996-44464EA9164D</string>
35+
<string>5CBA84AC-2517-437E-8596-079CE4775AC9</string>
3636
<key>IDESourceControlWCCName</key>
3737
<string>M13OrderedDictionary</string>
3838
</dict>

0 commit comments

Comments
 (0)