Choosing from a list of dictionaries in iOS shortcuts - ios

In the iOS Shortcuts app, I am using Get Dictionary on my x-callback return, which in fact returns many different dictionaries, which you can cycle through in Quick Look:
How do I allow the user of the shortcut to choose from the dictionaries, for example with the name field being presented to the user for each dictionary?
I imagine a Repeat with Each action is necessary - and indeed I found this answer, which appears to be out of date because I cannot seem to Get Dictionary from the the empty variable - Shortcuts won't let me.

Related

Adding Items from Lists to Dictionaries in Apple Shortcuts

I have this Shortcut which queries a Notion database, then fetches the IDs and titles of pages from the database and turns them into key : value pairs.
I want to add those key : value pairs to the dictionary shown at the top of the screenshot. The problem is, even though I can see that I'm adding to the dictionary inside the Repeat With Each Item loop -
When I check the contents of my Categories dictionary at the end of the Shortcut, those entries haven't been saved.
I have seen this answer, which appears to solve the same problem. But when I implement it and then check the contents of the variable inside the loop, nothing is even being set here.
I'd be very grateful for any pointers here.
I figured out the problem - I needed to set the dictionary as a variable outside the loop -
And then I can update the dictionary inside the loop -
I don't know why that works but it does ¯\(ツ)/¯

IOS Shortcuts: Setting (nested) dictionaries with application to modify EXIF data

I am trying to set values in a nested dictionary - similar to pythonic dict["key1"]["key2"]=value1 in Apple's my shortcut app on IOS 13. I fail even with a simple dict see attached screenshot which should add an element to the dict. The endgame is to modify EXIF metadata via the Metapho app - non-working example attached
I used ttwo approached
use a basic operation to modify dictionary
use prexisting shortcuts to modify dicitonaries as outline on the following Reddit threat Dictionary utilites.
To reproduce you need to download the attached shortcuts - and Dictionary utilties for the examples using those.
I first checked if I can modify a non-nested dict and nonnested dict.
Modifying non-nested dictionary
Using core tools I cannot add a key-value pair to a dictionary.
Minmal non-working exampleas per below.
Modifying non-nested dictionary using Dictionary tools
Minmal working example
Modifying nested dictionary using Dictionary tools
Using the same tools to modify nested dicts does not work.
Minimal non working example
Any help greatly appreciated. Asked same question on ask different
If values of a dictionary are modified the variable needs to be reset:
reset variable
Using this both nested and non-nested dicts can be modified without external tools.
Essentially this is called by value instead of call by reference. If those tools are used still their output needs to overwrite the variable in question.
Regarding modifying the underlying Exif values it is important it is important that again the output imagevariable needs to be written to new file in the photo app.
Mac

Storing an events calendar using NSUserDefaults or CoreData

So I have an app which upon launch imports a user's specific calendar and displays all events related to it. I use NSPredicate to sort them and store the events in an array.
I would like to be able to store this array upon each launch of the app, then in another method i hope to recall it and subtract it from the same calendar events at a later time. The idea being that only the changed items will remain.
I have tried using NSUserDefaults to store the array which is about 70 items long but i get an error : Property list invalid for format: 200 (property lists cannot contain objects of type 'CFType')
I have tried converting the array to NSData using NSKeyedArchiver but that causes a crash aswell: exception 'NSInvalidArgumentException', reason: '-[EKEvent encodeWithCoder:]
Any suggestions on how I can store and recall my events array. The reason i mention coreData in the title is i fear some of you will tell me to use that which is new to me.
Your approach is generally ok, but you're falling over at actually saving because you can't directly save an EKEvent (it isn't permissible in user defaults and it doesn't implement NSCoding).
You need to extract the parts, such as the eventIdentifier, from each EKEvent and store them in another object that you can add to user defaults (like a dictionary) or that you can archive (so it and its contents need to conform to NSCoding).
When you reload the data you would then compare each element of data you saved instead of comparing the whole EKEvents (not clear how you were doing the comparison anyway).

Parse, How to send array entries as multiple PFObjects, Create a new row for each array object

I'm using Parse as the backend for my app. My app will be used in the field where service will nonexistent or spotty at best so I need to store information offline. I currently save data for the user in a plist in the background (Title, location coordinates, notes, additional data). Since Parse's current iOS offline saving is fairly poor (From what I've read), I was hoping to get around it by creating an array or dictionary from the plist and upload that to Parse by giving it an array once the user is back in cell range.
As it occurs now, when I upload the array, it simply puts the entire contents of the array in a single cell in the database. Is there a way to parse the array and create a new row for each entry/object in the array?
I may have overlooked a better way to do this. If someone has a suggestion I would appreciate it!
I solved it. I iterated through the array using a for loop and added each index as a separate object.

how to get data form NSMutablearray in to NSString

Hello.......
in my apps, i have problem with xml parising .i have same tags differentiate with integer value.each tag has different value.
now the problem me facing is accessing this value for that particular tag only.
plz anybody have idea abat this.
let me know.
mean's the problem is that i have one MutableArray and all record in it. and i want to show some values in one view and reaming some value show in another view and reaming in another view..
But the MutableArray is same..
and one more thing is that i want to get tag value
<subject>XYZ</subject>
the output is subject i want.
i do not need of XYZ i need only subject..
sorry i can not show what i want but please understand my question and give me the answer
Thanks
Use NSMutableDictionary instead NSMutableArray.
From documentation.
The NSMutableDictionary class declares the programmatic interface to
objects that manage mutable associations of keys and values. It adds
modification operations to the basic operations it inherits from
NSDictionary.

Resources