Search Results

Search found 600 results on 24 pages for 'plist'.

Page 5/24 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Special characters from MySQL database (e.g. curly apostrophes) are mangling my XML

    - by Toph
    I have a MySQL database of newspaper articles. There's a volume table, an issue table, and an article table. I have a PHP file that generates a property list that is then pulled in and read by an iPhone app. The plist holds each article as a dictionary inside each issue, and each issue as a dictionary inside each volume. The plist doesn't actually hold the whole article -- just a title and URL. Some article titles contain special characters, like curly apostrophes. Looking at the generated XML plist, whenever it hits a special character, it unpredictably gobbles up a whole bunch of text, leaving the XML mangled and unreadable. (...in Chrome, anyway, and I'm guessing on the iPhone. Firefox actually handles it pretty well, showing a white ? in a black diamond in place of any special characters and not gobbling anything.) Example well-formed plist snippet: <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Rows</key> <array> <dict> <key>Title</key> <string>Vol. 133 (2003-2004)</string> <key>Children</key> <array> <dict> <key>Title</key> <string>No. 18 (Apr 2, 2004)</string> <key>Children</key> <array> <dict> <key>Title</key> <string>Basketball concludes historic season</string> <key>URL</key> <string>http://orient.bowdoin.edu/orient/article_iphone.php?date=2004-04-02&amp;section=1&amp;id=1</string> </dict> <!-- ... --> </array> </dict> </array> </dict> </array> </dict> </plist> Example of what happens when it hits a curly apostrophe: This is from Chrome. This time it ate 5,998 characters, by MS Word's count, skipping down to midway through the opening the title of a pizza story; if I reload it'll behave differently, eating some other amount. The proper title is: Singer-songwriter Farrell ’05 finds success beyond the bubble <dict> <key>Title</key> <string>Singer-songwriter Farrell ing>Students embrace free pizza, College objects to solicitation</string> <key>URL</key> <string>http://orient.bowdoin.edu/orient/article_iphone.php?date=2009-09-18&amp;section=1&amp;id=9</string> </dict> In MySQL that title is stored as (in binary): 53 69 6E 67 |65 72 2D 73 |6F 6E 67 77 |72 69 74 65 72 20 46 61 |72 72 65 6C |6C 20 C2 92 |30 35 20 66 69 6E 64 73 |20 73 75 63 |63 65 73 73 |20 62 65 79 6F 6E 64 20 |74 68 65 20 |62 75 62 62 |6C Any ideas how I can encode/decode things properly? If not, any idea how I can get around the problem some other way? I don't have a clue what I'm talking about, haha; let me know if there's any way I can help you help me. :) And many thanks!

    Read the article

  • Load array from plist in Documents Directory

    - by Florent
    Hi all ! I use to load plist which are in my main Bundle (Ressource folder) into an array using : NSString *path = [[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:nomPlist ]; NSMutableArray *tmpQuestion = [[NSArray alloc] initWithContentsOfFile:path]; arrayQuestion = [ [NSArray alloc] initWithArray:tmpQuestion]; [tmpQuestion release]; since i decide to change the content of my plist and that main bundle is read only how can i make this array loading plist from the Documents directory of my app ? ? thanks to all

    Read the article

  • How can I locate the frames of a spritesheet PNG based on this PLIST data?

    - by kitsune
    Someone asked me to reskin a certain game. Now he only sent me the whole sprite PNG and PLIST files of the sprites. He instructed me to rename each sprite with the same name corresponding to each original sprite. The problem is, he gave me the whole sprite sheet instead of each individual sprite and the PLIST. Now yes, I can read the PNG filenames from the PLIST, but I cannot rename the reskin sprites I did because I'm not sure which sprite is boy_gun_3_3.png; there are multiple guns, I don't know which is which. Is there a way to extract individual accurately named individual PNG files from the single sprite sheet using the PLIST?

    Read the article

  • key value coding-compliant for NSObject class?

    - by 4thSpace
    I've created a singleton class that loads a plist. I keep getting this error when I try to set a value: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key test.' I have one key in the plist file. The key is named "test" and has no value associated with it. I set the value like this: [[PlistManager sharedManager].plist setValue:@"the title value" forKey:@"test"]; I look at the set plist dictionary and see this from within PlistManager: po self.plistDictionary { test = ""; } I get the error just as I'm leaving PlistManager in the debugger. PlistManager is of type NSObject. So no xibs. Any ideas on what I need to do?

    Read the article

  • Creating a bundle - What's going wrong?

    - by joeylange
    Hello everyone, I've got a relatively simple one here. I'm making bundles to live inside the Resources folder of my application (and possibly in the Application Support folder). These bundles will contain template information for the data the application handles. I've constructed a bundle, with extension "booksprintstyle", and the directory structure is up to spec. I have an Info.plist all set and I think I've filled in all the values I need to. Do I need to change something in my App to have these folders-with-extensions recognized as bundle files, or am I missing something in my bundle structure? I noticed that some bundles have a file called PkgInfo; is that important? Below is the Info.plist from my bundle. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleGetInfoString</key> <string>1.0, Copyright © 2009 Joey Lange</string> <key>CFBundleIdentifier</key> <string>net.atherial.books.exporter.printingpress.printstyle</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>Books Print Style - Generic</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleDisplayName</key> <string>Books Print Style - Generic</string> <key>NSHumanReadableCopyright</key> <string>Copyright © 2009 Joey Lange</string> <key>CFBundleVersion</key> <string>1.0</string> </dict> </plist>

    Read the article

  • newbie need help ! !

    - by Florent
    ok guys so i'm new in iphone dev you know it ! I want to add badge from my app : i know how to in the application did finish launching. But i want to it depending on an int value i have stored in a plist (just one string an int value) i have placed on my server htt://anadress/myplist.plist How can i read the content of this value in the plist from my server thanks to all it'll help so much

    Read the article

  • Two dimensional array search in objective c

    - by Filthy Night
    Hi All, i want to ask question that how can we search in a plist which is of array type and has elements of array type as well. i am searching from a plist which is of string element type and its working fine, but i am not able to search when it has array elements in the plist. Regards!

    Read the article

  • error writing to plist

    - by Najeebullah Shah
    [array writeToFile:[documentsDirectory stringByAppendingPathComponent:@"data.plist" atomically:YES]; this line gives error that method -stringByAppendingPathComponent not found. whats the issue NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSArray *array = [[NSArray alloc]initWithObjects:@"First", @"Second", @"Third", nil]; [array writeToFile:[documentsDirectory stringByAppendingPathComponent:@"data.plist" atomically:YES]];

    Read the article

  • Correcting a plist with dictionaries

    - by ingenspor
    Plist is copyed to documents directory if it doesn't exist. If it already exists, I want to use the "Name" key from NSDictionary in bundleArray to find the matching NSDictionary in documentsArray. When the match is found, I want to check for changes in the strings and replace them if there is a change. If a match is not found it means this dictionary must be added to documents plist. This is my code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self managePlist]; return YES; } - (void)managePlist { NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Objects.plist"]; NSString *bundle = [[NSBundle mainBundle] pathForResource:@"Objects" ofType:@"plist"]; NSFileManager *fileManager = [NSFileManager defaultManager]; if (![fileManager fileExistsAtPath: path]) { [fileManager copyItemAtPath:bundle toPath:path error:&error]; } else { NSArray *bundleArray = [[NSArray alloc] initWithContentsOfFile:bundle]; NSMutableArray *documentArray = [[NSMutableArray alloc] initWithContentsOfFile:path]; BOOL updateDictionary = NO; for(int i=0;i<bundleArray.count;i++) { NSDictionary *bundleDict=[bundleArray objectAtIndex:i]; BOOL matchInDocuments = NO; for(int ii=0;ii<documentArray.count;ii++) { NSMutableDictionary *documentDict = [documentArray objectAtIndex:ii]; NSString *bundleObjectName = [bundleDict valueForKey:@"Name"]; NSString *documentsObjectName = [documentDict valueForKey:@"Name"]; NSRange range = [documentsObjectName rangeOfString:bundleObjectName options:NSCaseInsensitiveSearch]; if (range.location != NSNotFound) { matchInDocuments = YES; } if (matchInDocuments) { if ([bundleDict objectForKey:@"District"] != [documentDict objectForKey:@"District"]) { [documentDict setObject:[bundleDict objectForKey:@"District"] forKey:@"District"]; updateDictionary=YES; } } else { [documentArray addObject:bundleDict]; updateDictionary=YES; } } } if(updateDictionary){ [documentArray writeToFile:path atomically:YES]; } } } If I run my app now I get this message: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' How can I fix this? When this is fixed, do you think my code will work? If not, I would be happy for some suggestions on how to do this. I have struggled for a while and really need to publish the update with the corrections! Thanks a lot for your help.

    Read the article

  • Using info.plist for storing target-specific values for a multi-target app

    - by andybee
    I have a multi-target iPhone app which currently includes a header file with constant definitions that are conditionally included at build time depending on which target is being built. However, I was wondering if it might be better to instead include this information in the info.plist for the build, as this generally holds target-specific meta, so logically seems more appropriate. Therefore, my questions are: Is it acceptable to include custom (non-Apple defined) keys in the info.plist file? Is this a suitable place to include meta for the app which changes between targets?

    Read the article

  • Can not read and save a number from/into an .plist

    - by Flocked
    Hello, I created a property list with the name propertys.plist. Then I wrote this: NSString *path = [[NSBundle mainBundle] bundlePath]; NSString *finalPath = [path stringByAppendingPathComponent:@"speicherung.plist"]; NSMutableArray *plistData = [[NSMutableArray arrayWithContentsOfFile:finalPath] retain]; int a = [plistData objectAtIndex:1]; NSLog(@"%i", a); // returns 41386032, but the right number is 0 a = a + 1; NSNumber *ff = [NSNumber numberWithInt:a]; [plistData insertObject:ff atIndex:1]; NSLog(@"%@", [plistData objectAtIndex:1]); // returns 41386033 [plistData writeToFile:finalPath atomically:YES]; My app always get the wrong number. Why?

    Read the article

  • Updating a Safari Extension?

    - by Ricky Romero
    Hi there, I'm writing a simple Safari Extension, and I'm trying to figure out how to get the update mechanism working. Apple's documentation here is delightfully vague: http://developer.apple.com/safari/library/documentation/Tools/Conceptual/SafariExtensionGuide/UpdatingExtensions/UpdatingExtensions.html And here's my manifest, based on that documentation: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Extension Updates</key> <array> <dict> <key>CFBundleIdentifier</key> <string>net.rickyromero.safari.shutup</string> <key>Team Identifier</key> <string>TMM5P68287</string> <key>CFBundleVersion</key> <string>1</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>URL</key> <string>http://rickyromero.net/misc/SafariExtensions/ShutUp.safariextz</string> </dict> </array> </dict> </plist> I don't know where to get "YourCertifcateID," for example. And when I increment the values for CFBundleVersion and CFBundleShortVersionString, it doesn't trigger an update. I know Safari is hitting my manifest though, because I'm watching HTTP traffic. Thoroughly stumped. Any ideas, guys?

    Read the article

  • NSString to NSURL objects

    - by user337844
    Hello, I have an array that I populated with my plist file, which looks something like this: <array> <string>http://www.apple.com</string> <string>http://www.google.com</string> <string>http://www.amazon.com</string> </array> So, I'm looking to convert these NSString objects to NSURL objects when I call them in my didSelectRowAtIndexPath method. Any ideas? This is what I have right now: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; if (self.viewController == nil) { TemplateViewController *details = [[TemplateViewController alloc] initWithNibName:@"TemplateViewController" bundle:nil]; self.viewController = details; [details release]; } NSString *tempURLString = [tieroneurlArray objectAtIndex:row]; NSURL *loadingUrl = [NSURL URLWithString:tempURLString]; [tieroneurlArray addObject:loadingUrl]; viewController.title = [NSString stringWithFormat:@"%@", [tieroneArray objectAtIndex:row]]; [self.viewController setTableURL:[tieroneurlArray objectAtIndex:row]]; TemplateAppAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.templateNavController pushViewController:viewController animated:YES]; } And this is how I load the array with the plist: - (void)viewDidLoad { [super viewDidLoad]; NSString *path = [[NSBundle mainBundle] pathForResource:@"tier1Names" ofType:@"plist"]; tieroneArray = [[NSMutableArray alloc] initWithContentsOfFile:path]; NSString *tableURL = [[NSBundle mainBundle] pathForResource:@"tier1URL" ofType:@"plist"]; tieroneurlArray = [[NSMutableArray alloc] initWithContentsOfFile:tableURL]; }

    Read the article

  • MooseX::Types declaration issue, tight test case :)

    - by TJ Thompson
    So after an embarrassing amount of time debugging, I've finally stripped this issue ([http://stackoverflow.com/questions/4621589/perl-moose-typedecorator-error-how-do-i-debug][1]) down to a simple test case. I would humbly request some help understanding why it's failing :) Here is the error message I'm getting: plxc16479 $h2/tmp/tmp18.pl This method [new] requires a single argument. at /nfs/pdx/disks/nehalem.pde.077/perl/5.12.2/lib64/site_perl/MooseX/Types/TypeDecorator.pm line 91 MooseX::Types::TypeDecorator::new('MooseX::Types::TypeDecorator=HASH(0x655b90)') called at /nfs/pdx/disks/nehalem.pde.077/projects/lib/Program-Plist-Pl/lib/Program/Plist/Pl.pm line 10 Program::Plist::Pl::BUILD('Program::Plist::Pl=HASH(0x63d478)', 'HASH(0x63d220)') called at generated method (unknown origin) line 29 Program::Plist::Pl::new('Program::Plist::Pl') called at /nfs/pdx/disks/nehalem.pde.077/tmp/tmp18.pl line 10 Wrapper test script: use strict; use warnings; BEGIN {push(@INC, split(':', $ENV{PERL_TEST_LIBS}))}; use Program::Plist::Pl; my $obj = Program::Plist::Pl->new(); Program::Plist::Pl file: package Program::Plist::Pl; use Moose; use namespace::autoclean; use Program::Types qw(Pattern); # <-- Removing this fixes error use Program::Plist::Pl::Pattern; sub BUILD { my $pattern_obj = Program::Plist::Pl::Pattern->new(); } __PACKAGE__->meta->make_immutable; 1; Program::Types file: package Program::Types; use MooseX::Types -declare => [qw(Pattern)]; class_type Pattern, {class => 'Program::Plist::Pl::Pattern'}; 1; And the Program::Plist::Pl::Pattern file: package Program::Plist::Pl::Pattern; use Moose; use namespace::autoclean; __PACKAGE__->meta->make_immutable; 1; Notes: While I don't need the Pattern type from Program::Types in the above code, I do in other code that is stripped out. The PERL_TEST_LIBS env var I'm pulling INC paths from only contains paths to the project modules. There are no other modules loaded from these paths. It appears the MooseX::Types definition for Pattern is causing problems, but I'm not sure why. Documentation shows the syntax I am using, but it's possible I'm misusing class_type as there isn't much said about it. Intent is to be able to use Pattern for type checking via MooseX::Params::Validate to verify the argument is a 'Program::Plist::Pl::Program' object. I've found that removing the intervening class Program::Plist::Pl from the equation by directly calling Pattern-new from the tmp18.pl wrapper results in no error, even when the Program::Types Pattern type is imported.

    Read the article

  • Writing a plist

    - by iOS-Newbie
    I am trying to test out writing a dictionary to a plist. The following code does not report any errors, but I cannot find any trace of the file that I supposed wrote. Here is the code snippet: NSDictionary *myDictionary = [NSDictionary dictionaryWithObjectsAndKeys: @"First letter of the alphabet", @"A", @"Second letter of the alphabet", @"B", @"Third letter of the alphabet", @"C", nil ]; I can see the dictionary contents displayed properly with either method calls: NSLog(@"Here is my partial dictionary %@", myDictionary); for (NSString *key in myDictionary) NSLog(@"here it is again %@ %@", key, [myDictionary objectForKey:key]); The following code displays the "succeeded" message when the program is run repeatedly if ([myDictionary writeToFile: @"myDictionary" atomically:YES ] == NO) NSLog(@"write to file failed"); else NSLog(@"write to file succeeded"); even when changing the atomically: argument to NO to not write a temporary file. However, when I search my current directory, or even my entire Mac, I cannot find any file called "myDictionary.plist" or any file with the string "myDictionary". Isn't the path variable "@myDictionary" supposed to represent the file at the current directory, i.e. where the class executable resides?

    Read the article

  • Remove applications from Security -> Privacy -> Contacts list

    - by noloader
    I have a few applications that want access to my contacts. I don't really use contacts, and I don't want applications entitled to the information. I've unchecked the appropriate box, but I'd like to remove the application from the list: I've got a couple of applications under Location Services, too (including one Wifi stumbler application that's no longer installed). What plist do I modify to remove the applications from the list?

    Read the article

  • How can I migrate all keyboard shortcuts from one mac to another?

    - by cwd
    I have a lot of custom keyboard shortcuts and will be migration Macs. I tested Migration Assistant and it did not seem to get these. I read somewhere that they are stored in the individual application's plist files in the ~/Library/Application Support folder but even after copying a few of these folders over the shortcuts do not seem to follow. How can I get all of the keyboard shortcuts migrated to a new mac?

    Read the article

  • Compare then download

    - by zsjpj
    Hi all ! I have a plist in my document folder of the app with one string, an int value. An another plist is on my server with also a string, an int value. How can i compare the two int value and then do something if one is bigger than the other thanks to all

    Read the article

  • Info on UIDeviceFamily key in Info.plist

    - by dbv
    The iPad programming guide says I have to include the UIDeviceFamily key in Info.plist. It also says that the transitioning a target to iPad should have added the key. It didn't. I tried creating blank projects, both iPad-only and universal, and neither got that key. Google comes up short too. What's the story on this mysterious key? The simulator doesn't mind the fact it's missing.

    Read the article

  • Invalid Entitlement.plist for my iphone?

    - by Rajendra Bhole
    Hi, i m sending .ipa file and ad-hoc provisional profile to my friend for installing my application in his iphone through itunes of windowsXP But it shows invalid entitlement.plist for his iphone. please reply me as soon as possible, Thanks in advance for sending me answer.

    Read the article

  • Question regarding the iPhone In App Purchase capabilities

    - by Wesley
    Hi everyone. I am working on releasing an app that will greatly benefit from using the in app purchase model. The app is a sort of book viewer, and the content I would like to make available for purchase will be more books in various languages. Each book is stored in sqlite format, in separate .db files. Now, the way that my developer has set it all up is that he added a line onto the bottom of the info.plist file called databases. Inside that database section, I can type in 'es' as the key, and for the value the name of the spanish database, and it populates in a uitableview in spanish, using NSLocale. So it is very easy to setup and implement different databases, which is great, but now I am confused about how I can implement my in app purchase model. Sorry about the long winded intro, here is my question: Is it possible to have an in app purchase add a line to my info.plist file? Or if not, is it possible to have the purchase reveal a new and updated plist file altogether that I would have already setup correctly? Any help here would be appreciated. Thanks

    Read the article

  • Mac OS X Lion no longer recognizes environment.plist?

    - by Michael Irwin
    Just installed Lion today and my PATH env variable is no longer being set by ~/.MacOSX/environment.plist. Did something change? Can't seem to find any info on that or how to fix. Any ideas? Here's the contents of the PLIST: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11/bin:/Users/mdi/bin</string> </dict> </plist>

    Read the article

  • How can I get a Node adjacent to a unique Node using Scala?

    - by pr1001
    I'm trying to parse an Apple plist file and I need to get an array Node within it. Unfortunately its only unique identifier is sibling Node right before it, <key>ProvisionedDevices</key>. Right now my best thoughts are to use Java's XPATH querying or Node.indexOf. Here is an example: <plist version="1.0"> <dict> <key>ApplicationIdentifierPrefix</key> <array> <string>RP8CBF4MRE</string> </array> <key>CreationDate</key> <date>2010-05-10T11:44:35Z</date> <key>DeveloperCertificates</key> <array> ... <key>ProvisionedDevices</key> <array> ... // I need the Nodes here </array> </dict> </plist> Thanks!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >