Using CloudKit console to add image data to a record - cloudkit

I am trying to set up a small CloudKit database using the console app to use during development of my app. The database has just a few records with only two fields each: a string as a name and an asset which is supposed to refer to an image. When adding a new record I click in the image field the console lets me pick a file, say "DSC_0175.jpeg" and "DSC_0175.jpeg (2823.05KB) ready to upload" appears in the field. (I get the same if I drag and drop the image file into the field.) However when I click Save, I get an error message at the bottom of the record panel saying "Load failed" and while the record gets saved with its name field, the image field is empty in the resulting record. Any suggestions for what I'm doing wrong.

Related

How to format the text in a textArea component in Matlab so that it always displays the latest value?

I am building a MATLAB app using app designer and I have a textArea component which I use to display output message to the user using the app. The component name is OutputStatusTextArea_1 and i set the value of nb_Text to 0 in the startup function.
Whenever I need to display a message I use the following command:
app.nb_Text = app.nb_Text + 1;
app.OutputStatusTextArea_1.Value(app.nb_Text) = strcat({'# '},'New Message')
What happened is at some point the number of message fill completely the text area and then everytime i add a message, the user needs to scroll down to see it.
What I would like is to be able to always display the last message at the bottom of the TextArea and that the user needs to scroll up if he wants to see old message. Is there a way to do so?
have you tried the setCaretPosition function? see this post
https://www.mathworks.com/matlabcentral/answers/255486-set-edit-uicontrol-to-last-line

How would you save user's profile data from firebase in cache Swift

I have a view controller that is basically the average user's profile on any social media app (showing data like their name, followers, following, name, bio and profile picture). I have successfully made it so all the relevant data get's retrieved from my firebase database.
However, whenever I go out of that view controller and back in again, from the profile screen to a post and back to their profile screen, it reloads all the data again which caused the hard coded values of the profile like 'Name' for the name label to show every time they go out and back into the view controller.
So my question is, how would I retain all the data in a cache - I guess, so it looks like its only loaded the data once (obviously in the background it will check for a change every time you reload the view).
If i'm correct you can solve that problem for string based values (like their name and followers number) by using the firebase offline capabilities? How would I do the same for stuff like their profile picture? Save the picture in a cache and then update it whenever there's a change?
Thanks,
Nathan
EDIT: Here's a video of my problem: here as you can see in the video, when you go back out of the view controller, and then back in, the image has to be loaded again. Is there any way to save that imaged to a cache so the next time the profile is opened it will already be there.

How to get user input with UITextView in different cells in UITableVIew

so I have a UITableView and within each cell, a UITextView. I want the user to be able to edit each UITextView as many times as they like, then go back to somewhere else in the app, close the app, whatever, and then come back and see the same thing they wrote. I have not been able to figure out how to do it.
Please help. I'm still pretty new to Swift.
This is a design problem. Anyway my suggestion is to add a flag in your data model.
Data model (the data that you are presenting in your table). If you don't have any data model, add one.
Example:
class UserInformation {
name: String
isEditing: Bool = false
}
and then save this in your preferred location either in DB (core data, realm etc) or plist (which i don't recommend)
now during the creation of cell. You could just check if this is in editing mode. And then fill up the text field using the saved data.
EDIT: You can't just magically know/retain a state in an object without persisting.
You want to store textView informations in any case, including terminating application, there are some steps to implement this feature.
At first, you have to pick up a place for storing your information:
Hard disk
Your own server
Other service (firebase ...)
RAM is not useable in this case.
Supposing you like hard disk option, let's select a method for storing:
Create a file (JSON, text file, ...), save your information every time user enter a new one, open it to get information back.
Save it by CoreData / Realm in database way (CoreData is like SQL lite, a lite weight database for mobile application supported by Apple)

Wicket DefaultDataTable - Refresh it on browser back button

In my application I am using DefaultDataTable with SortableDataProvider which has LoadableDetachableModel as the model.
I used it to display a set of records ( say RecordList page). When I add or remove some records and load the page RecordList again, it displays the changes. However, if I use the back button of the browser and go the RecordList page which was rentered earlier ( before adding/ removing the records ). The DefaultDataTable still has the old sets of records. This is a big issue when records are deleted.
For example, If I delete a record and press back button then the page fails as the record it is trying to show does not exist in the database. Adding does not create an issue because it simply does not get listed in the set of records.
In another page, I just have PageableListView with LoadableDetachableModel. It works fine with out an issue.
There are one or two things that you can do about this.
First please check whether the data provider has the latest data.
Secondly make sure that the set of records with the Data provider is refreshed when the browser back button is hit. Ensure that the data fed to the Data Provider is refreshed in a method other than constructor. Because constructors will not be called when you hit back. So you would need to use a separate method. Ideally you could use the same method, but called from both constructor and when back button is pressed.

How to referesh one view UI from other view UI

I have two Views called UserView and RoleView.
UserView.xaml contains RadGridView which contain three columns
UserID (Label) | UserName (Label)| Role (Dropdown).
RoleView.xaml contains one TextBox where i can add Roles into database.
Role (Textbox).
Step 1. Now first i open the UserView.xaml and it will display
records from database with appropriate roles.
Step 2. Now i open new page RoleView.xaml (minimize UserView.xaml).
Step 3. I have added one role. (AdminRole)
Step 4. Now i open UserView.xaml (it is already in memory, so just i
navigate to this page)
Step 5. Now i double click to any of the row with Role (Dropdown
column) it will comes into edit mode and populate list of roles.
**but it will not display recently added role (AdminRole) in dropdown. because of the data source will not getting referesh.**
If i am closing the UserView.xaml and reopen this page then it will display recently added role (AdminRole) in dropdown.
Note: my requirement is like, i have to update or notify all opened views once any of the change from anywhere.
I am using
Silverlight 4 (MVVM)
PRISM
telerik RadGridView
Your help/comment/suggestion would be highly appreciated!
Thanks,
Imdadhusen
Prism comes with an Event Aggreator. Where you have publishers and subscribers to these events, which we'll call "messages". Have a look at the MDSN link below:
http://msdn.microsoft.com/en-us/library/ff921122(v=pandp.20).aspx
What this means is you can have each view subscribe to an update message and have them update whenever they receive this message. So you could send an "update" message each time a view changes.