Hi everyone,
I have a NSMutableDictionary, and my keys are objects (and the class implement the NSCopying protocol).
I add a value in the dictionary associated to a key, then, when I call the objectFoKey: method for the key which is in the dictionary, randomly, sometimes the method call "isEqual" and the key is found, and sometimes, th...
I can't seem to work out how to get a Dictionary representing an object from the dictionary that TouchJSON returns.
For example:
If I use the JSON in the format here:
http://search.twitter.com/search.json?q=hello
How would I get a tweet with the "id" = x without having to pull all of the tweets into an array using a "for" statement?
...
I had not run into this before but I wanted to know if it's possible to store KEYS with special characters in Objective-C / Cocoa Touch
Since one can force a line break in a NSString with \n I wanted to store some values in a plist (and they do need to be the keys). It's just about 20 lines to static data (well, the keys, the values are...
Hi,
I'm writing an app in XCode 3.2.3 for iOS 4. In my code, I am creating an NSArray of NSDictionaries, each containing two key/value pairs, a string and an NSArray of NSDictionaries (kind of confusing, I know). Just to give you a visual, here is the structure:
<NSArray>
<NSDictionary>
<NSString/>
<NSArray>
...
A web service provides data in the form of a plist. After the download, I have all of the data in an NSData object, which I want to convert to an NSDictionary. Right now the only way I know of to do that without parsing it by hand (yuck) is this:
static NSString *fileName = @"tempFile";
[data writeToFile: fileName atomically: NO];
NSD...
hi,
i'm still trying to wrap my head around using NSDictionaries, and have come into a situation where i believe i need to use one. essentially, i would like to store all the phone numbers associated with each contact into a dictionary. so far i have this:
ABAddressBookRef addressBook = ABAddressBookCreate();
NSArray *thePeople = (NSA...
I want to create an NSManagedObject with the contents of a NsDictionary. and Visa Versa.
I have a NSDictionary with object and keys that is being brought in from a MYSQL database and stored to the documents directory. I can't find good info for editing a dictionary so I thought I would try NSManaged Object instead.
If the Object attri...
So I have an NSDictionary that contains several objects with properties (key:values), but the issue is that I need them in a specific order.
Stored as an NSArray is a list of objects that I would like to use as keys for the NSDictionary.
I can output the NSArray and NSDictionary to the Console, however when I to access each of the valu...
I have a bunch of NSDictionaries thats stored in an NSArray. The dictionaries store coordinates for buttons, their name, and their relating object to load when pressed (UIView).
When the button is pressed I can retrieve which button it is in string format, for example "settings" and I would like to then run the object -(void)settings{}....
I'm trying to sort an array that would look something like this:
(please ignore the fact these people are well past any living age! I just needed large numbers)
NSDictionary *person1 = [NSDictionary dictionaryWithObjectsAndKeys:@"sam",@"name",@"28.00",@"age",nil];
NSDictionary *person2 = [NSDictionary dictionaryWithObjectsAndKeys:@"cody...
I have a dependent UIPicker that loads the values into its two components from a plist. It's an NSDictionary with NSArrays of strings. The user selects a pair of components and the picker sends those two strings back to the delegate. What I really need is a constant that goes along with each individual choice. For example, first comp...
Hi I have a json string converted unsing the JSON framework into a dictionary and I need to extract its content. How could I iterate to the nested dictionaries? I have already this code that allows me to see the dictionary:
NSDictionary *results = [responseString JSONValue];
NSMutableArray *catArray = [NSMutableArray array];
for (id k...
Hi,
I have an UITableView that contains 3 NSArrays and 3 NSDictionaries for each array.
- (void)viewDidLoad {
[super viewDidLoad];
contentArray = [[NSMutableArray alloc] init];
self.settingsArray = [NSArray arrayWithObjects:@"Settings", nil];
NSDictionary *settingsDict = [NSDictionary dictionaryWithObject:settings...
Hey there, my app has a search bar that searches a plist file. I've created the plist file but I keep
getting this error:
[Session started at 2010-07-27 19:11:07 +0530.]
2010-07-27 19:11:12.550 InfoCarApp[2062:20b] *** -[NSCFDictionary allkeys]: unrecognized selector sent to instance 0x3d51440
2010-07-27 19:11:12.552 InfoCarApp[2062:20b...
Hi
So i have a uiviewcontroller. It has a property of an NSMutableArray with a nonatomic, retain property synthesized.
In the viewDidLoad I init it with the following, and also add a button to the nav bar.
test = [NSDictionary dictionaryWithObjectsAndKeys:
[[SearchField alloc] initWithName:@"Subject" :Text], kSubjectKey,
...
This is kinda confusing so please bear with me.
I have an array (listOfStates) of dictionaries. Where listOfStates has this structure:
{stateName} - {stateCapital}
{Alabama} - {Montgomery}
{Alaska} - {Juneau}
{Arizona} - {Phoenix}
...
{West Virginia} - {Charleston}
{Wisconsin} - {Madison}
{Wyoming} - {Cheyenne}
This is the code used ...
Hello,
in an iPhone app, the User can create Items - each Item needs to have a CGPoint, NSString and a few integers with information about it. The User can keep adding these Items.
How can i store all these variables for each of the Items and programmatically keep adding them to a list or array or something?
I tried using a struct arr...
In my app, there is a portion that holds a static contacts directory. I would like the directory to appear indexed (alphabetically) and the detail view will need to be grouped also. (I am somewhat trying to replicate the look and feel of the Contacts app.) I have it working, just no index and a detail page that is just a view with a col...
hi,
I have a question.
If i have a NSArray i can put into a NSDictionary?
If i can, how can do these?
Thanks
...
So i'm using touch JSON which worked out pretty well for me. I was able to take an array, put it in a dictionary, serialize it via touchJSON and send it out via http.
now on the return end, i received the data, and put it into a dictionary (i'm using trends.json from twitter as an example JSON).
now if i try to get the value for tren...