Hey!
I am currently trying to get data out of a plist.
It basically looks like that:
plist called 'woerter'
-> Root key of type Dictionary
-> woerter key of type Array
-> various Items of type String with string Values
When I now try to read a random string from it, I only get a (null) expression
NSString * path =...
Hi,
I'm struggling with trying to sort an array of dictionarys.
My dictionaries have a couple of values of interest, price, popularity etc.
Any suggestions?
...
All objects used as keys in NS(Mutable)Dictionaries must support the NSCopying protocol, and those objects are copied when they're used in the dictionary.
I frequently want to use heavier weight objects as keys, simply to map one object to another. What I really mean when I do that is effectively:
[dictionary setObject:someObject forKe...
I have a class with an NSDictionary attribute. Inside this class I dispatch another thread to handle NSXMLParser handling. Inside my -didStartElement, I access the dictionary in the class (to compare an element found in the XML to one in the dictionary).
At this point I get undefined results. Using NSLog (I'm not advanced in XCode debug...
I have an iPhone app with a secondary thread to handle XML parsing. Inside some of those methods, I need to reference dictionaries (for look up, not modification) created and populated in the main thread.
Apple's documentation indicated to me that global variables might be the best way to accomplish this. I'm just now sure what the impl...
I am a .NET programmer and new to Objective C.
I am trying to make a UIPickerView which acts like a .NET dropdownlist. User sees the list of text and selects one and the selected value (which is the ID) is used in code.
I have been browsing for almost half a day trying to figure this out. I could add a regular PickerView with list of...
I have one dictionary I need to save into a plist. The paletteDictionary always returns nil:
- (void)saveUserPalette:(id) sender
{
[paletteDictionary setObject:matchedPaletteColor1Array forKey:@"1"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirector...
Why does this code...:
NSDictionary *testDictionary = [NSDictionary dictionaryWithObjectsAndKeys:kABOtherLabel, @"other", kABWorkLabel, @"work", nil];
// There are 9 more key-value pairs that i've omitted here.
throw this warning:
warning: passing argument 1 of 'dictionaryWithObjectsAndKeys' from incompatible pointer type
Incidental...
I am attempting to store NSMutableDictionaries as a blobs in sqlite, by first converting it into NSData via either NSPropertyListSerialization or NSKeyedArchiver.
When I store the blob, the NSData object's length is in the thousands (KB range). When I get it back, it's been truncated to 10 bytes. When I check the DB through SQLite Brow...
Is there a way to remove duplicate (key-value) pairs from NSDictionary ?
EDIT:
My description was misleading, I have duplicate pairs e.g.
key1-value1
key1-value1
key2-value2
key1-value1
etc..
...
Hi guys!
Currently I'm receiving a list of objects from a SQLiteDB by using:
-(NSMutableArray*) getMoreForObjectIdByCategoryId:(NSInteger) itemId: (NSInteger) categoryId
On the ViewController Side, I'm using the
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
in combination w...
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...
I've been trying to come up with a way to solve my problem, but every solution I can think of is messy and makes me want to retch.
I have a one-to-many relationship, consisting of a Team object that can have many Member objects. When I built my data model using Xcode, I was given the default NSSet in which to store the member objects, ...
I've run into the same problem as found in this question. However, I have a follow-up question. I seem to be in the same situation as the original asker: I have a plist with a hierarchy of dictionaries that define a configuration screen. These are not mutable and will stay the same throughout the application. Since the original discussio...
Compare the following:
using NSUserDefaults saving it with synchronize
using NSDictionary saving it with writeToFile in the app Documents folder
What are the differences? Personally, I prefer to mantain different NSDictionary organized by topic rather than use a single NSUserDefaults.
Am I thinking something wrong? Thanks
...
Hi
I'm trying to write an NSDictionary to a plist but when I open the plist no data has been written to it.
From the log my path looks correct and my code is pretty standard.
Any ideas?
NSArray *keys = [NSArray arrayWithObjects:@"key1", @"key2", @"key3", nil];
NSArray *objects = [NSArray arrayWithObjects:@"value1", @"value2", @"value3...
I have a nib file that contains a window/view and an instance of NSObjectController. I programatically load the window in the nib setting "self" as owner.
"self" is my custom classs that defines an IBOutlet: an NSDictionary called settings. I now want to have that dictionary as content for the object controller. Is there a way to connec...
Sorry if the question isn't correct, I'm very new in Objective-C.
I understand why this code throw the Warning: "warning: passing argument 1 of 'initWithObjectsAndKeys:' makes pointer from integer without"
NSDictionary *dictNames =
[[NSDictionary alloc] initWithObjectsAndKeys:
3, @"",
4, @"",
5, @"",nil];
Keys and Value...
I have a UINavigationController consisting of a tableview I want to load some data into.
I have a dictionary plist containing Dictionaries for each Train Line which in turn have dictionaries for each station with the relevant information along with one string lineName. I need to collect the station Names keys and add them to an array to...
I know it's needed if your object will be used as a key in an NSDictionary. Are there any other times like this that NSCopying is required?
If I think I don't need my model objects to conform to NSCopying, am I probably wrong?
...