|
|
#1 |
|
NSArray to NSMutableArray
Just had a quick question.
I have a method in a Class that sorts an array, gets information and then returns an NSArray with this code. Code:
NSMutableArray *itemsFromSkill = [BoilerPlateCode returnItemsForSkill:itemStringLabel withItemList:skillsListDict]; I remember a while back reading something about this and this is not the correct way but I can't remember? I think I would need to convert an NSArray to an NSMutableArray with a method like makeMutableCopy or something. It' not a big deal. I was just wondering. Thanks.
__________________
I know more than yesterday. Lars |
|
|
|
0
|
|
|
#2 |
|
Code:
[NSMutableArray arrayWithArray:(NSArray *)]
__________________
2012 Mac Mini, 2.6 GHz, 16GB RAM, 1TB HDD ![]() 2.4Ghz 15" Macbook Pro ![]() 32 GB iPhone 4S : 16 GB iPod nano : 16 GB iPad 3 Nikon D60 : 18-55 mm VR : 55-200 mm VR |
|
|
|
0
|
|
|
#3 |
|
Of just add [(code that returns a NSArray * here) mutableCopy];
|
|
|
|
0
|
|
|
#4 |
|
OK That clears it up. So there is a correct way of doing it. I went a head and convert my method to return an NSMutableArray.
Thanks.
__________________
I know more than yesterday. Lars |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 06:59 AM.







2012 Mac Mini, 2.6 GHz, 16GB RAM, 1TB HDD
Linear Mode
