iam using cloudkit for backup , what i do is inserting text into file and then upload it with ckmodifyrecordsoperation and i provide a ui to show the progress that return from the function completion handler ,
first time in upload, it takes it time in order to upload
, second time it upload the file (as i overwrite the same file in cloudkit) so fast as the progress handler is called three times or less , i want to know why does that happen in the second and (later times of course)
thanks
i canot find any answer for that for now and i found this link but didnot help that much CloudKit records saving progress
Related
We have couple excel files are used by several departments, and we would like to track on user and saved time. excel can read some info, but not accurate if the file got recovered.
For these files, they can be updated, then got recovered to prior version. There is a need to share all info upon time and user that saved the file in the last month.
Is it achievable by using powershell codes ?
Thank you for your time in advance.
May
I need to record video and upload them to Server. They will be added in queue and uploaded one by one.
My question is, when i record a video, where should i save it till it gets uploaded ?
Should i save it in Album ? or in private documents directory ?
I also need to delete the video once it is uploaded.
According to ios guidelines, is it required to save the video in Albums only ? Will my app be rejected if it is saved in Documents directory for longer period?
If they are not user-created (or if you do not want them to participate in stuff like iCloud), then do not put them in APPHOME/Documents.
The preferred location is APPHOME/Library/Caches but that location can get cleaned by the iOS on a system restore (and possibly other times -- documentation does not specify). It's not going to happen on a regular basis though, so it's the first option if you can regenerate the data on rare occasions like restore.
So, if the files can be recreated, keep them in APPHOME/Library/Caches. If they cannot, then place them somewhere else in APPHOME/Library.
Just make sure you remove them when you are done with the upload.
You're ok, you can save/delete them in/from the Documents directory. Instead, you can't delete videos/photos from the user's albums. No problem for the "longer period".
I want to put all my app logs in a file in the Documents directory and then once user tap on "Upload logs" in the application, logs will be uploaded to server. I am planning to keep logs for two days. Is there any limit on the size which I can use for the logs?
Also, at all point in time I want to keep last 2 days logs and deleting the old ones. How can that be achieved?
Since you are storing them in the Documents directory, you are not bounded to a specific file size. As for only keeping the last two day's log files, you could just write a pruning function to delete any old ones and call it on app launch & resume from background.
I've had this weird bug in my application for a while, maybe you guys can help me.
Here's the given:
The application downloads (a lot of) images and stores them in the Library/Caches directory.
For every image downloaded, the url and filename is stored in an SQLite database. As you can see, I've re-invented the wheel and created my own "caching" system. I've done this to help reduce the memory footprint of the application when it has to download a lot of images.
I have a UITableViewController that displays some text data, as well as (some of) the downloaded images, in its cells. The filename is queried from the database everytime the following is called:
- (UITableViewCell*) tableView: (UITableView*) tableView
cellForRowAtIndexPath: (NSIndexPath*) indexPath
The queries are of the form:
SELECT filename, imageTitle, etcetera
FROM tbl_images
WHERE url = 'http://www.foo.com/bar'
Here comes the problem:
When scrolling up or down really fast on a tableView, thereby causing a lot of queries to be executed in a short amount of time, the app "breaks" and the queries return empty rows, and never works correctly again unless you restart it. I'm guessing the database connection is lost somehow or something, but I can't really be sure.
Anyone have an idea on what is happening and/or how to fix it?
EDIT
OK guys, I just found the cause of the bug. When it is reproduced, I found that the database has been corrupted somehow.
Thanks for the comments, though, and sorry for wasting your time. v^_^'
Well you can load the items from the data base into a datasource, may be a array of arrays. Each subarray will have the information for a particular row. Whenever new file is downloaded just update the file path. You can then store the images to disk and read from the file path. If the data is NULL you can show a activity indicator untill it gets downloaded.
In your downloading method, you can pass a value which indicates which row the image should fit into. When download completes you can update the filepath. Doing so you will reduce/remove the need to cache the images in a database.
Did you check return codes from sqlite3_prepare_v2? Also you may cache prepared statement to make it very fast on population to database. Did you open database connection each time when requesting this information?
Without code for working with database it's hard to tell why you get such picture.
You can use "lazy" method to represent data. For example in UIScrollViewDelegate *scrollViewDidEndDragging:willDecelerate:* and scrollViewDidEndScrollingAnimation: methods call for data from database and fill rows w/o data (or with some minimal data)
Merged with Changing the current date.
I am working on a project which downloads data On click of a button.The user should be allowed to download the next data after 24 hours. How can a event handler be used to execute the above problem
suppose i download the data today, it should allow me to download next data tomorrow(24 hours)
thanks in advance.