0
votes
2answers
44 views

Objective c: Getting error when adding object into NSMutableArray during threading

Here is what I want to achieve. 1. Searching all the files 2. find all .jpg files during the searching 3. save all .jpg file paths into NSMutableArray Here are the codes: Created the ...
0
votes
2answers
49 views

Beginning NSMutableArray - Debug ignored

I am just learning objective-c. Hopefully this is a simple fix for anyone that has worked with NSMutableArrays before. Note: I have watched 3 videos on you tube and read 5 articles before asking ...
1
vote
2answers
71 views

Crash Using insertObject in NSMutableArray

I have a NSMUtableArray where I want to insert at different index and in different method some data. So I initialize my NSMutableArray in my viewDidLoad like this: - (void)viewDidLoad { [super ...
1
vote
1answer
67 views

Getting error after execute NSMutableArray

Here is the code. I tried to create a object which includes the name, size and image(get from the resource) and then I add that object into NSMutableArray in order to show those object in NSTableView. ...
0
votes
2answers
67 views

How to compare and merge NSMutableArray

I have 2 NSMutableArrays that contains an instances of the class Person. I need to check is there any Person with same value of "name" in both of arrays and merge it with ask about replace instances ...
0
votes
1answer
78 views

Array Controller not updating Table View until “Add” button is pressed

I'm new to Cocoa and Objective-C, so I'm following the Lynda courses and learning a lot. Thing is, I've encountered a problem that I cannot figure out, even though I seem to be doing it exactly the ...
1
vote
1answer
86 views

Encode NSMutableArray

EDIT: Ok i decided to save the array in the userDefaults... should be easy, right ? Save: NSUserDefaults *userDefs = [NSUserDefaults standardUserDefaults]; [userDefs setObject:videoArray ...
0
votes
1answer
97 views

AXUIElementRef and ARC - Deallocated instances and __bridge vs __bridge_transfer

I get this error on an NSMutableArray: -[Not A Type release]: message sent to deallocated instance 0x1006e29c0 It happens on this line: [_array removeAllObjects]; Now, I understand what ...
0
votes
2answers
27 views

Add/Edit/Move Custom TableViewCell?

**.h IBOutlet UITableView *Table; NSMutableArray *Currency; NSArray *Datacell; ** Create Custom array Custom *usd = [Custom new]; usd.name = @"USD"; usd.detail = @"United States Dollar"; ...
0
votes
3answers
63 views

adding current and future dates to an array

I am creating a custom type calendar and I am trying to see if it is possible to store dates in an array without statically assigning each one. For example the 1st date in the array would be the day ...
1
vote
5answers
261 views

Differences between [NSArray arrayWithArray:] and [NSArray copy]

lately I work much with arrays and I'm wonder.. what's diffrences between those two lines. NSArray *array = [NSArray arrayWithArray:someArray]; and NSArray *array = [someArray copy]; Which of it ...
2
votes
2answers
117 views

How to save/archive an NSMutableArray containing custom objects?

I have an NSMutableArray *recordsArray, the keys are NSStrings, and the values are a custom object: @interface DictRecord : NSObject{ } @property (nonatomic, retain) NSString* word; @property ...
0
votes
1answer
79 views

NSMutableArray denies to function

I'm planning to do editable array of strings. so first I created the property: @property (strong, nonatomic) NSMutableArray *history; Then I made the lazy instatiation: - (NSMutableArray *)history ...
0
votes
3answers
98 views

Combine 100 NSMutableArrays into one controllable object

Ok, I basically need to find a way to better manage 100 NSMutableArrays of data. Like, (I haven't actually done this) : NSMutableArray *array1; NSMutableArray *array2; NSMutableArray *array3; ...
1
vote
2answers
111 views

Unexpected behaviour when inserting object into NSMutableArray

So I've been working on Project Euler problem 25 in Objective-C and I ran up against the size limit of NSDecimalNumber. So after attempting to use other code libraries I decided to re-represent my ...
1
vote
2answers
41 views

How to Mirror an NSMutableArray? [duplicate]

How does one mirror an NSMutableArray (first element becomes last one, second becomes second to last, ...)?
1
vote
2answers
235 views

[__NSArrayI replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance

I have a NSMutableArray, which I need to chance its values, but I have this error: [__NSArrayI replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance 0x5291db0 This is the ...
1
vote
3answers
107 views

NSMutableArrays are null

I have an NSViewController subclass with: @property (retain) NSMutableArray* entities; @property (retain) NSMutableArray* tiles; In my -init method, both arrays are created with +new, and are given ...
0
votes
2answers
81 views

NSMutableArray from different class gets Null

I've this class: @interface PersonModel : NSObject @property (nonatomic, weak) NSString *string; @property (nonatomic, weak) NSMutableArray *array; @end and in another class, I use that string ...
-5
votes
2answers
112 views

What is the benefit of insertObject:atIndex: over replaceObjectAtIndex:withObject: on an NSMutableArray

When replacing a value at some index with a new value within an NSMutableArray, the old value is held in memory. The hack to fix is to initialize a new NSMutableArray before every loop. Steps to ...
0
votes
0answers
125 views

Memory is not getting released

When I run the following program ... application is holding some 5MB of memory even after releasing all objects ... when I don't add an object to list everything works fine ... but I am not sure why ...
0
votes
0answers
72 views

NSMutableArray row count remains at 0

My initialisation method initialises two objects and then uses them to populate an instance of NSMutableArray. However, in a later method when I am creating my NSTableView and need to extract the row ...
0
votes
0answers
260 views

Reading NSMutableArray from File

I am trying to read an 2 NSMutableArrays from file. I am saving and loading as such: SAVE: NSMutableDictionary *saveDict = [NSMutableDictionary dictionary]; [saveDict setValue:name forKey:@"name"]; ...
0
votes
1answer
34 views

Reading string from array then changing string and outputting new result

I am trying to grab a string in my array, change nth letter in the string to a ?, then print the result in a textfield. The problem is my NSMutableArray is being stored into a UIPickerView and I think ...
12
votes
4answers
2k views

Is there a literal syntax for mutable collections?

I know I can create an NSArray with @[@"foo", @"bar"] or an NSDictionary with @{@0 : @"foo", @1 : @"bar"}. Is there a literal syntax for creating an NSMutableArray or an NSMutableDictionary?
0
votes
2answers
200 views

NSNull in NSMutableArray

allItems is an NSMutableArray and when the user clicks the plus button the method createItem gets called. I'm trying to only add objects (of the class BNRItem) for every even number index, so I tried ...
0
votes
4answers
760 views

How To Use objectAtIndex In an Array Object

I'm trying to get to grips with Objective C and Cocoa so I may be using the wrong terminology here. I've made an Objective C class for a deck of cards that is read by my main AppDelegate.h & ...
0
votes
1answer
111 views

How to parse data into an array or dictionary

I have an app that makes multiple connections to different servers at the same time. I want to record each connection in an array so I can display them in a tableview and use them in a different ...
2
votes
3answers
743 views

how to get NSPopUpButton selected object?

I'm having a student class: @interface student : NSObject{ NSString *name; NSDate *date; } and i have a NSMutableArray for list of students, and i bound it to a NSPopUpButton like this ...
0
votes
1answer
190 views

arraycontroller nsmutablearray add programmatically

I trying to add a data on table view via Array Controller thats bind to a NSMutableArray. On the IB property it looks like this : and on the code I tried to add the NSMutableArray dynamically then ...
-1
votes
1answer
142 views

Issues with NSMutableArray and my table

I'm trying to be able to insert an object into my table, but it crashes because of an uncaught exception whenever I hit the add button. It says Attempt to insert row 0 into section 0, but there are ...
0
votes
1answer
56 views

cocoa - can't access instance variable on button click

I have a method called getProjects. In my method I parse data from json. I save name and id of the project in my instance variable projectsArray which is an NSMutableArray. The problem is that I have ...
2
votes
1answer
169 views

Remove NSWindowController from NSMutableArray when window is closed

I want to be able to create multiple instances of a window in a Cocoa application. Therefore I have created a NSWindowController and associated XIB. In my application delegate I have the following ...
0
votes
1answer
91 views

How do I express “if object intersects 'any object in this array' then…”

Been trying to work on a simple game while learning Xcode and Objective-C. I'm trying to get an object which falls from the top of the screen to land on a platform. There are multiple platforms which ...
0
votes
2answers
327 views

nsmutablearray elements to nsstring

I want to retrieve elements that are parsed in a NSMutableArray and store them into a NSString variable and then store them in NSMutableArray as NSString (because I want to display the content in a ...
0
votes
0answers
46 views

textfield value not assigned in table

I've got a simple table with one textfield that after I press add button I want to add that value to table. Here's my .m file of model @implementation rebar @synthesize bar; @synthesize area; ...
-1
votes
2answers
81 views

Access two elements of NSArray at a time

I am using an NSMutableArray to hold some objects, and I need to access the element at i and the element at i+1 in the same line. Also, is there any way to access the NSMutableArray's length?
1
vote
2answers
176 views

Find out which object being added to NSMutableArray is nil [closed]

I started a project using ARC, and I'm inserting a few objects into an NSMutableArray. The objects have all started out as NSStrings, and when attempting to add these objects into the array, I get the ...
0
votes
2answers
129 views

How to remove NSDate objects from a NSMutableArray

I have been working with NSArrays and NSMutableArrays that store NSDate objects for a few days now. I noticed that calling [listOfDates removeObject:date1] removes all the NSDate objects from the ...
0
votes
1answer
121 views

How to calculate the hash MD5 of each content of a NSMutableArray?

I have this: NSString *string1 = ...; NSString *string2 = ...; NSMutableArray *array = [NSMutableArray alloc]inithWithObjects:string1, string2]autorelease]; How do I calculate the MD5 hash (or ...
2
votes
3answers
542 views

NSMutableArray - array pop equivalent

If I want to pop the last item from my NSMutableArray would this be the most proper way? id theObject = [myMutableArray objectAtIndex:myMutableArray.count-1]; [myMutableArray removeLastObject]; I'm ...
0
votes
1answer
181 views

Accessing an NSMutableArray inside my custom object

I'm sure this is an complete Noob question... but I've actually never had to deal with this scenario before so I'm a bit befuddled... Let's say I have a custom object I'll call person, and each ...
3
votes
1answer
138 views

NSTable and NSMutableArray Sorting

I have an NSTableView that I am trying to sort. The data source is an NSMutableArray which contains instances of custom classes. -(void)tableView:(NSTableView *)tableView sortDescriptorsDidChange: ...
0
votes
1answer
380 views

What's the result of passing just nil to arrayWithArray:?

What happens when you pass nil to arrayWithArray:? Let's say I have the following code: NSMutableArray *myArray = [NSMutableArray arrayWithArray:someOtherArray]; If someOtherArray happens to be ...
0
votes
1answer
200 views

NSTableView contents not being refreshed properly

I've set up an NSTableView, whose columns are bound to an NSArrayController which gets its contents from an NSMutableArray (Matches) of NSMutableDictionary instances. Although the thing is working, ...
0
votes
3answers
149 views

sorting NSmutable array contains object according to double value

I want to order NSMutableArray contain objects according to two of object property one of them has double type second has NSString ? I tried to use this method but I got exception : NSString * ...
-2
votes
1answer
190 views

NSMutableArray - sorting a custom class [duplicate]

Possible Duplicate: How to sort an NSMutableArray with custom objects in it? I have a custom class where one of the values are names. Imagine the class is called Person. I would like to ...
2
votes
3answers
3k views

NSKeyedArchiver and NSKeyedUnarchiver with NSMutableArray

I'm hoping this isn't something to do with the fact that I'm using a Mutable array here, but this one is baffling me so it wouldn't surprise me if that were the case. BACKGROUND: I have made a small ...
3
votes
4answers
422 views

How do I add data into NSMutableArray by manually assigning index?

Is there any way to manually control which index we want to add our data to with an NSMutableArray? In PHP, for example, we can do: $foo[2] = "fafa"; $foo[8] = "haha"; Can the manual assigning of ...
3
votes
1answer
173 views

NSMutableArray: is it faster to remove all objects or to init a new NSMutableArray?

Even though this has minimal impact on my code right now I would like to understand if an operation is more costly than the other :-).

1 2 3 4
15 30 50 per page