nsmutablearray

Exception when sorting NSMutableArray which contains all NSDate objects.

//list has type of NSMutableArray NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES] autorelease]; [list sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; I got this exception: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSDate 0x5d57980> v...

Using Core data to store objects(pointing to seperate views) in a NSMutableArray .

Hello All, I am new to the iOS. Currently, I am using 3.1.3 base SDK for development and testing. I am developing an application to store credentials. In my Main menu, I have a NSMutable Array with some default cells(objects in NSMutableArray speak) and then the option to add some arrays.Currently I am able to add new cells and remove c...

How can I copy a part of a mutable array into a buffer, to send it via cfstreamwrite to a host

Hi friends, need some help: I have created a mutable array of ASCII- strings (21 per Key), which I like to transfer to a socket by using CFStream. Each string represents a key stroke (1 of 8). Here is the code, I'm using: // socket- initialising: for writestream, host, port, buf static CFWriteStreamRef writeStream = NULL; static C...

Error When adding Object to NSMutableArray

Hi all, I am getting errors when trying to add items to a NSMutableArray which is encapsulated within an object. Code follows: #import <Foundation/Foundation.h> @interface TestObject : NSObject { NSMutableArray *myArray; } @property (nonatomic, retain) NSMutableArray *myArray; @end #import "TestObject.h" @implementation Te...

Problem to access to a NSMutableArray of an object

Hi everyone, I post this topic because I have a problem with my iPhone application since 3 days. I hope someone can help me because I'm going crazy. Here is the thing : I fill in an object userXMLData,in the delegate of my application, with a XML Parser. This object contains many NSStrings and a NSMutableArrays which contains objects t...

NSXMLParser and memory management issues

I've been trying to implement NSXMLParser and so far I've had memory issues, performance issues or it doesn't work. I worked originally from a example off the net and it leaked a heap of memory. I released the objects properly but found that there was a performance hit because I would alloc and then release each object for each element....

Retain and self with NSMutableArray

In my .h file I have a NSMutableArray *locationsArray defined with a property as follows @property (nonatomic, retain) NSMutableArray *locationsArray In my .m file I was displaying a table view, this loaded fine until I tried to roll-up at which point I it crashed with bad access. This was due to the locationsArray not being retained...

NSMutableArray - removeallobjects produces a leak

Hi Forum I have a mutableArray that I fill up with objects. When I try to refill the array, I first use removeAllObjects - which produces a memory leak... The properties of the object are synthesized, retained and released on dealloc. The Array is initialized on viewDidLoad like this: theArray = [[NSMutableArray alloc] initWithCapaci...

iPhone SDK - Sandbox - From Library folder in Simulator to Library folder in final device.

Hi. I've used NSMutableArray writeToFile for created a file(levels.txt) which contains the levels state on my game (level locked, unlocked or level done) Level0: Done Level1: Unlocked Level2: Locked ... Level8: Unlocked ... The resulting file(XML) is in /Users//Library/Application Support/iPhone Simulator/4.0/Applications//Library/le...

iPhone SDK: Passing NSMutable Array to controller not working

Hi there! I have an NSMutableArray countHistory defined and am trying to pass it to the next view controller: Updated Code: NSLog(@"Debug One"); HistoryTableViewController *controller; NSLog(@"Debug Two"); controller = [[HistoryTableViewController alloc] initWithNibName:@"HistoryTableViewController" bundle:nil]; NSLog(@"Debug Three");...

How to use the same category in multiple classes?

I have stack category for NSMutableArray that I use in Class A @implementation NSMutableArray (StackUtil) - (void)push:(id)stackObject { [self addObject:stackObject]; } - (id)pop { id retVal = [[self lastObject]retain]; [self removeLastObject]; return [retVal autorelease]; } @end How do I properly include this category for fo...

iPhone SDK: NSMutableArray count causes EXC_BAD_ACCESS

Hi everyone This is really twisting my mind… I'm trying to access an NSMutableArray in an IBAction which I defined in viewDidLoad. Unfortunately I keep getting a EXC_BAD_ACCESS. I'm new to all this so I'd really appreciate some insight in what I'm doing wrong. Below find the corresponding code excerpts. CounterViewController.h: @in...

How can i get Original order of NSDictionary/NSMutableDictionary ??

i have created NSMutableDictionary with 10 keys.Now i want to access NSMutableDictionary keys in a same order as it was added to NSMutableDictionary (using SetValue:* forKey:* ); How can i achieve that ? ...

Copying Multi-Dimensional NSMutableArray

I'm currently working on a Sudoku application, the numbers are stored within a Multi-Dimensional NSMutableArray of NSNumbers. I keep an array in my SudokuGridView, for displaying the numbers in the grid. When it comes time to solve the puzzle, I pass a [grid numberGrid] to a subclass of NSOperation I've created that solves the puzzle. T...

my mutablearray doesn't work

hello guys sorry for my stupid question (beginner) I got the demo program Accelerometergraph the apple site and would like to use mutablearray in the values of acceleration x. but my mutablearray contains only one object, there being several passage mutablearray routine and should contain the same number of objects that the counter show,...

NSMutableArray with file path

I have a NSMutableArray of names of files in my app documents folder. Now I want to make an array of file paths of those files which have names in the above array. How am I gonna do this? I'm having trouble solving this and I couldnt think of any solutions. If you could help, I really appreciate it. Thanks a lot in advance. ...

NSMutableArray stored with core data = WORKS, but after changing array DOESN'T WORK

Hello, I have a NSManagedObject with a NSMutableArray as attribute: @interface MyObject : NSManagedObject { } @property (nonatomic, retain) id a1; In the data model it is declared as Transformable. I left the Value Transformer field like it is with the default (in light grey) NSKeyedUnarchiveFromData. a1 is created as part of th...

Is NSMutableArray writeToFile recursive?

Does NSMutableArray support recursive serialization? E.g. will a NSMutableArray of NSMutableArray's serialize the entirety of the heirarchy out when calling writeToFile? Example: NSMutableArray *topArray = [[NSMutableArray alloc] init]; NSMutableArray *bottomArray = [[NSMutableArray alloc] init]; NSString *foo = @"foo"; NSString *bar...

How to convert the NSMutableArray to CSV file on iPhone?

Hi, everyone, I am writing an iPhone application, which contains a function. It can convert the NSMutableArray to a CSV file. However, I don't know how to do. Can anyone help me to do this? Thank you very much. // ------ Update ----- Thank you for everyone reply. Actually, the array contains the objects of the elements, but I can co...

How to deal with booleans in NSMutableArrays ?

Can someone tell me why my application crashes here ? and why it does not crash when i replace the YES objects with NSString values ? all i want to do is to store boolean data into array and to modify these data later, can someone please tell me how to do this ? - (void)viewDidLoad { [super viewDidLoad]; NSMutableArray* arr = ...