nsmutablearray

Loading an NSArray on iPhone from a dynamic data base url in PHP or ASP

I have a database online that I would like to be able to load into an NSArray in my app. I can use arrayWithContentsOfURL with a static file, but I really need to go to a url that generates a plist file from the database and loading it into the array. I can use ASP or PHP. I tried setting the response type to "text/xml", but that doesn'...

iPhone Setting ViewController nested in NSMutableArray

Hello I'm trying to set attributes for a viewcontroller nested inside a NSMutableArray, for example I have 3 ViewController inside this array: FirstViewController *firstViewController = [FirstViewController alloc]; SecondViewController *secondViewController = [SecondViewController alloc]; ThirdViewController *thirdViewController = [Thir...

Storing acceleration values in Objective-C/Cocoa?

Hi all, I'm writing for the iPhone and I'm trying to measure the time between maximum accelerations. Imagine you've attached your iPhone to an oscillating spring. What I want to do is measure the frequency of the oscillation. The way I am going about doing this is storing a certain number acceleration values (updated 20 times per sec...

NSArray in NSArray do not return the image I want

Hi there, I've got a code snippet here that I can't make working. NSUInteger i; //NSMutableArray *textures = [[NSMutableArray alloc] initWithCapacity:kNumTextures]; //NSMutableArray *texturesHighlighted = [[NSMutableArray alloc] initWithCapacity:kNumTextures]; NSMutableArray *textures= [[NSMutableArray alloc] init]; for (i = 1; i <...

How to get all indexes of object in NSMutableArray?

There is a method for index finding called indexOfObject which returns a first value: [mutableArray indexOfObject:[NSNumber numberWithFloat:someValue]]; The simple solution is to make loop and find all objects with the same value. Is any better way to get array of indexes for specific value? ...

How to sort NSMutableArray of NSMutableDictionary?

I have NSMutableArray of NSMutableDictionary(NSString objects). One of NSString object is actually a date, and i need to sort NSMutableArray based on that date and I don't want it to sort dates as strings. How can i make it? ...

Problem with NSMutableArray

Hi, I have a problem with NSMutableArray. In my program i have a lot of variabile "CFSocketRef". i want to save this in NSMutableArray but i can't. Can you help me? Thank and sorry for my english XP My code: CFSocketRef socketAccept; NSMutableArray *arrayIP = [[NSMutableArray alloc] init]; self.socketAccept = CFSocketCreateWith...

Objective-C NSMutableArray Count Causes EXC_BAD_ACCESS

I've been stuck on this for days and each time I come back to it I keep making my code more and more confusing to myself, lol. Here's what I'm trying to do. I have table list of charges, I tap on one and brings up a model view with charge details. Now when the model is presented a object is created to fetch a XML list of users and parses...

How to solve the leaks when allocating the NSMutableArray in Objective-C

Hi Guys, I am getting leaks in Master view controller of iPhone. When I call this method, I am inserting them into filteredListCount array, because when I search I need to show the list from filteredListCount array otherwise customerArray. This functionality is working fine but I am getting leaks in the method below at allocation: fil...

How to store/retrieve an NSMutableArray of objects?

How do I store/retrieve an NSMutableArray of objects? The easy / fast way please. Thanks! ...

NSMutableArray Problem - iPhone

Hi, I'm trying to get a UITableView to read it's data from a file. I've attempted it like this: NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *fullFileName = [NSString stringWithFormat:@"%@/entries.plist", documentsDir...

Images in the project NOT adding to array - don't know why.

Hi there, I have to sets of images. Each set has 16 images. One set is called 0.png through to 15.png the other is a0.png through to a15.png. In my app, it loads each one dependent on a variable (which by logging, I have proved it works) here is the code [MemoryManager sharedMemoryManager]; NSLog(@"THEME: %@", [MemoryManager shared...

NSMutableArray of NSString in CoreData(iPhone

I have a class, which describe an object for parsing XML. This class contains NSStrings and NSMutableArrays of NSStrings.I want to store parsed data using CoreData. How should I write CoreData model to store such objects if there is no such data type like NSMutableArray? Is there any way? ...

IPhone SDK, Display an NSMutable array in Table view?

Hi, i have tryed to display my NSMutableArray in a Table View by following a tutorial. It has completley failed for some reason, i think i have a good idea why but cannot get around it, this is my code: - (void) scoreSystem { scoreArray = [[NSMutableArray alloc] init]; NSNumber *onescore = [NSNumber numberWithInteger:score]; [scoreArray...

Removing Objects From NSMutableArray

Hi, I have a NSMutableArray that contains all the calendars on my system (as CalCalendar objects): NSMutableArray *calendars = [[CalCalendarStore defaultCalendarStore] calendars]; I want to remove from calendars any CalCalendar objects whose title does not include the string @"work". I've tried this: for (CalCalendar *cal in calenda...

Cocoa structs and NSMutableArray

I have an NSMutableArray that I'm trying to store and access some structs. How do I do this? 'addObject' gives me an error saying "Incompatible type for argument 1 of addObject". Here is an example ('in' is a NSFileHandle, 'array' is the NSMutableArray): //Write points for(int i=0; i<5; i++) { struct Point p; buff = [in readD...

Can you append a NSMutableArray to a file?

Hi. I am trying to write some data from an NSMutableArray to a plist, while keep the old plists content. The function writeToFile:atomically: overwrites the old contents with the new, I want to append the objects in the new array to the plist. How can this be done? Thank you. How can you check for duplicates while doing this? ...

Access problem with NSMutableArray

Hi, my problem is that I can't access my NSMutableArray in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {}. I create my NSMutableArray here: nodes = [xmlDoc nodesForXPath:@"/xml/items/item/short_desc" error:nil]; if (nodes != nil && [nodes count] >= 1) { for (int i = 0; i <...

Getting unique items from NSMutableArray

Hi Guys, I have a question about Objective-C today involving NSMutableArray. Coming from a .net/c# background I'm having some trouble working with these things. Let's say I have an object called "Song" My song has 3 properties: Title Artist Genre I have a NSMutableArray or NSArray wich holds all my Song objects. How would I go ab...

Problem adding data to NSMutableArray

I'm trying to add the value playerhight, among other values to NSMutableArray, but it won't let me build and I can't figure out why. #import "iGameViewController.h" @implementation iGameViewController @synthesize player; int playerheight; NSMutableArray *location = [NSMutableArray arrayWithCapacity:3]; -(IBAction)up;{ playe...