Route Me: Caching Tiles limit? - objective-c

I am using the route me frame work for my map application.
I badly want to cache more tiles than its caching by default.
So i changed the routeme.plist like this:
<?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">
<array>
<dict>
<key>capacity</key>
<integer>16</integer>
<key>type</key>
<string>db-cache</string>
</dict>
<dict>
<key>capacity</key>
<integer>100000</integer>
<key>minimalPurge</key>
<integer>5000</integer>
<key>strategy</key>
<string>LRU</string>
<key>type</key>
<string>memory-cache</string>
<key>useCachesDirectory</key>
<true/>
</dict>
</array>
</plist>
But it doesn't matter which values i change, the app always reloads tiles which i have already seen before. Is there a limit for caching?

Related

info.plist is not saving changes made

I have been trying to edit my info.plist to use geolocation, every time I do I save the file but when re-running the build it reverts back to its default form without the changes. Can anyone please help, below is the file in question.
<?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>LastAccessedDate</key>
<date>2019-07-03T05:00:01Z</date>
<key>WorkspacePath</key>
<string>/Users/JingoLine/repAsc/ios/repAsc.xcworkspace</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is required for xyz benefits for you</string>
</dict>
</plist>
on Re-run it goes back to :
<?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>LastAccessedDate</key>
<date>2019-07-03T05:00:01Z</date>
<key>WorkspacePath</key>
<string>/Users/JingoLine/repAsc/ios/repAsc.xcworkspace</string>
</dict>
</plist>

How to launch verdaccio (forked version of sinopia) at boot on mac OS X?

I tried to create .plist at /Library/LaunchDaemons but it doesn't run.
It follows below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.verdaccio</string>
<key>Program</key>
<string>/usr/local/bin/verdaccio</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Thanks in advance.
The right answer to have it working is as below:
<?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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.verdaccio</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/verdaccio</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>igor</string>
<key>SessionCreate</key>
<true/>
</dict>
</plist>

Can a single-file command line tool written in objective-c handle a URL Scheme?

Using Xcode, is it possible to create an Objective-C or C single-file tool (i.e, no app bundle) that handles a custom URL schema?
I've added -sectcreate __TEXT __info_plist Info.plist_path into my other linker flags and below is my info.plist that is supposed to be added to the binary (not sure how I can confirm that is is being added). But, building the binary doesn't result in myCoolURLHandler://key=value being handled by the new tool.
I've very new to objective-c and Xcode, so I am sure I am missing something.
My info.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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>Apple.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>URLHandlerTestApp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myCoolURLHandler</string>
</array>
</dict>
</array>
</dict>
</plist>

How to find the number of values in a plist?

I have a plist that looks like the following.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
Translations
-->
<plist version="1.0">
<array>
<dict>
<key>English</key> <string>Hello Mrs./Mr./Miss.</string>
<key>French</key> <string>Bonjour Madame / Monsieur / Mademoiselle.</string>
<key>Spoken</key> <string>Boh(n)-zhoor mah-dahme/ muh-syuhr/ mah-dah-mwa-sell.</string>
</dict>
<dict>
<key>English</key> <string>Excuse me.</string>
<key>French</key> <string>Pardon.</string>
<key>Spoken</key> <string>Par-doh(n).</string>
</dict>
<dict>
<key>English</key> <string>Do you speak English?</string>
<key>French</key> <string>Parlez-vous anglais?</string>
<key>Spoken</key> <string>Par - lay vooz ah(n)-glay?</string>
</dict>
</array>
</plist>
I want to know how to find how many elements are in the plist. For example, there is 3 in the code above. Is there an attribute of plist I can call to find this number?
Read the plist into an array:
NSArray *plistArray = [NSArray arrayWithContentsOfFile:pathToPlistFile];
and count the number of elements:
NSUInteger count = [plistArray count];

using NSPredicate on nested dictionary/array

I'm trying to use a deeply nested data structure and NSPredicate to filter that data.
I have a plist file like this:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>images-ipad</key>
<array>
<dict>
<key>categories</key>
<array>
<string>standard</string>
</array>
<key>name</key>
<string>Default</string>
<key>plist</key>
<string>cardSheet.plist</string>
<key>png</key>
<string>cardSheet.png</string>
</dict>
<dict>
<key>categories</key>
<array>
<string>standard</string>
</array>
<key>name</key>
<string>Optional</string>
<key>plist</key>
<string>cardSheet.plist</string>
<key>png</key>
<string>cardSheet.png</string>
</dict>
<dict>
<key>categories</key>
<array>
<string>christmas</string>
<string>holiday</string>
<string>standard</string>
</array>
<key>name</key>
<string>christmas</string>
<key>plist</key>
<string>cardSheet.plist</string>
<key>png</key>
<string>cardSheet.png</string>
</dict>
</array>
</dict>
</plist>
Which I load into an NSDictionary via dictionWithContentsOfFile.
I then want to get the elements of the array images-ipad that are in the category 'standard' via NSPredicate. I think this is possible, but I've not been able to accomplish it, and the docs don't seem to cover nested data structures.
So, I've tried this:
NSPredicate *getcat = [NSPredicate predicateWithFormat:#"ANY images-ipad.categories == 'holiday'"];
NSArray *res = [[dict objectForKey:#"images-ipad"] filteredArrayUsingPredicate:getcat];
but it does not return any elements, which brings me to stackoverflow. Thanks in advance.
Since you're filtering the result of [dict objectForKey:#"images-ipad"], you shouldn't include that string in the key path of the predicate, as it's basically equivalent to looking up images-ipad.images-ipad.categories, which doesn't exist.