nsmutabledictionary

NSMutableDictionary in iPhone

After adding the key value pairs in NSMutableDictionary, when i retrive the key/values from it, will that retrived key/value be removed from NSMutableDictionary? or is it stil maintained in NSMutableDictionary? ...

Objective-C NSMutableDictionary Disappearing

I am having this problem with the NSMutableDictionary where the values are not coming up. Snippets from my code look like this: //Data into the Hash and then into an array yellowPages = [[NSMutableArray alloc] init]; NSMutableDictionary *address1=[[NSMutableDictionary alloc] init]; [address1 setObject:@"213 Pheasant CT" forKey: @"S...

NSMutableDictionary, alloc, init and reiniting...

In the following code: //anArray is a Array of Dictionary with 5 objs. //here we init with the first NSMutableDictionary *anMutableDict = [[NSMutableDictionary alloc] initWithDictionary:[anArray objectAtIndex:0]]; ... use of anMutableDict ... //then want to clear the MutableDict and assign the other dicts that was in the array of dic...

NSMutableDictionary is adding quotes to keys and values - why?

I'm trying to add some additional key/value pairs to an NSMutableDictionary, using: Tag *tag1 = [results1 objectAtIndex:0]; [resultsDict setObject:[tag1 retrieveTextUpToDepth:1] forKey:@"image_url"]; Tag *tag2 = [results2 objectAtIndex:0]; [resultsDict setValue:[tag2 retrieveTextUpToDepth:1] forKey:@"majority"]; This adds the k/v pa...

A NSMutableArray is destroying my life!

IET ANOTHER EDIT (to increase strangeness) EDITED to show the relevant part of the code Hi. There's a strange problem with an NSMutableArray which I'm just not understanding... Explaining: I have a NSMutableArray, defined as a property (nonatomic, retain), synthesized, and initialized with 29 elements. realSectionNames = [[NSMutableA...

Issue passing NSMutableDictionary to a method

Hello all, I've got a chunk of code that's passing an NSMutableDictionary (amongst other things) to a method in another class: [self.shuttle makeAPICallAndReturnResultsUsingMode:@"login" module:@"login" query:credentials]; The NSMutableArray credentials is previously defined like this: NSMutableDictionary *credentials = [[NSMutableD...

NSMutableDictionary is being treated as an NSDictionary

Hi, I have a simple class with an NSMutableDictionary member variable. However, when I call setObject:forKey I get an error ('mutating method sent to immutable object'). The source of the problem is obvious from the debugger -- my NSMutableDictionary is actually of type NSDictionary. I must be missing something incredibly simple but c...

Accessing NSMutableDictionary Across Classes

I have declared an NSMutableDictionary object in AppController.h and initialized in the corresponding AppController.m file. AppController.h #import <Cocoa/Cocoa.h> @interface AppController : NSObject { NSMutableDictionary *uberDict; } AppController.m #import "AppController.h" @implementation AppController - (id)ini...

How to use NSMutableDictionary to store and retrieve data

I have created Window Based application and tab bar controller as root controller. My objective is to store Text Field data values in one tab bar VC and will be accessible and editable by other VC and also retrievable when application start. I am looking to use NSMutableDictionary class in AppDelegate so that I can access stored Data Va...

how do we access values stored in NSMutableArray of NSMutableDictionary ?

I have stored values in NsMutableDictionaries . ThenI stored all the dictionaries in NSMutable Array. I need to access the values ? How can I do that ? -(void)viewDidLoad { [super viewDidLoad]; self.title = @"Library"; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButton...

iPhone app throwing EXC_BAD_ACCESS with dictionary from contents of file

I have the code NSArray *paths = [[NSArray alloc] initWithArray:NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)]; NSString *docsDirectory = [[NSString alloc] initWithString:[paths objectAtIndex:0]]; NSLog(@"This app's documents directory: %@",docsDirectory); NSString *docsDirectoryWithPlist = [[NSS...

How to check if an NSDictionary or NSMutableDictionary contains a key?

I need to check if an dict has a key or not. How? ...

How to get the key for a given object from an NSMutableDictionary?

I have an object which is in an big NSMutableDictionary, and need to find out which key this has. So I want to look up that "table" from both columns. Not only with keys, but also with objects (to get keys). Is that possible? ...

Sorting array containing strings in objective c

Hello experts! I have an array named 'names' with strings looking like this: ["name_23_something", "name_25_something", "name_2_something"]; Now I would like to sort this array in ascending order so it looks like this: ["name_25_something", "name_23_something", "name_2_something"]; I guess that should start of with extracting the numbe...

NSArrayController not working with NSMutableDictionary for NSTableView

Hi all, I am trying to display content in NSTableView using NSMutableArrayController of NSMutableDictionary records. I followed steps written below: In application delegate class, I created an NSMutableArray object with name 'geniuses' and stored some NSMutableDictionary objects with keys: 'geniusName' and 'domain'. I took an NSArray...

NSMutableDictionary with UIButton* as keys - iPhone development

Hi, I'm new to iPhone development and I have a question that may have a very simple answer. I am trying to add buttons to a view and these buttons are associated with a custom class that I defined. When I add the buttons to the view, I would like to know what class these buttons correspond to. This is because when I press the button, I n...

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 setObject:forKey in a NSMutableDictionary

I am trying to record how much time my users are staying in a particular skin in my app. I have two mutable dictionaries one that relates my skins' index values to their names and one that relates their names to the time spent viewing them. My problem is that went it goes to increment the time the call to set the new time fails. The firs...

What type of file do i use for NSMutableDictionary withcontentofURL?

I want to fill a NSMutableDictionary with content out of a URL File. What type file must it be and how must it be structured? NSMutableDictionary *myMutableDictionary = [[NSMutableDictionary alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://example.com/list.txt"]]; ...

Public class: The best way to store and access NSMutableDictionary?

I have a class to help me store persistent data across sessions. The problem is I want to store a running sample of the property list or "plist" file in an NSMutableArray throughout the instance of the Persistance class so I can read and edit the values and write them back when I need to. The problem is, as the methods are publicly defi...