ERROR: shrink of file system cache did not fully complete. Result: 21 - ios

its my first day using ios 7
i get this line in log hundreds of times per second.
i didn't get it before with the same code with iOS 6
maybe thats caused by :
[NSData dataWithContentsOfURL:(NSURL *)];
it does not happen when i remove this line
do anybody know what's the meaning of this error ?

Related

Crash-safe append() in Swift

After updating to iOS 14 Developer Beta my app began crashing. Mainly it happens on line axis.entries.append(Double(f)) of the library which I use for creating charts. Here is the console output:
Fatal error: UnsafeMutablePointer.initialize overlapping range: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1200.2.19.2/swift/stdlib/public/core/UnsafePointer.swift, line 832
Fatal error: UnsafeMutablePointer.initialize overlapping range: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1200.2.19.2/swift/stdlib/public/core/UnsafePointer.swift, line 832
I don't believe I can fix this library, so I want a simple solution just to prevent my app from crashing. This line axis.entries.append(Double(f)) is being called multiple times without crashing, so what I want to do is to perform this append if it won't crash my app and don't perform append if it will. Is there a way to implement this?
I have tried putting this line inside try and if, but with no result.

withSessionContinueSeconds method doesn't work in Flurry

I have the following code:
let builder = FlurrySessionBuilder.init()
.withAppVersion(appVersion)
.withLogLevel(FlurryLogLevelAll)
.withCrashReporting(true)
.withSessionContinueSeconds(20)
I wanted to increase the number od seconds before the session times out because of the nature of the app I am writing. However, the session timeout is still after 10 seconds rather than the 20 I have specified in my code.
How can I fix this?

iOS 7: Strange AVAssetExportSession bug

I have used AVAssetExportSession to join 2 video files. It works fine in iOS 6 but has very strange bug in iOS 7.
Let me explain this bug. I have 2 video files, the first video is 8 seconds duration and the second is 81 seconds duration. In iOS7, it will be fine if I do the second + the first. But if I do the first + the second, it will be error:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x176cb5c0 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x176ca000 "The operation couldn’t be completed. (OSStatus error -12633.)", NSLocalizedFailureReason=An unknown error occurred (-12633)}
I have checked exportPresetsCompatibleWithAsset and supportedFileTypes. There is no problem with it. Could anyone tell how to fix this? Any help would be appreciated.
Does anyone know this bug :(. I provide 2mp4 files which cause the bug: test 1, test 2. Do join "test 2" + "test 1" is fine, but do "test 1" + "test 2" will cause an error. It only happens in iOS7
I found that you can replace AVAssetExportSession with SDAVAssetExportSession. You can then specify settings instead of using presets which provide different results across different devices.
I had to change __weak typeof(self) wself = self; to
__weak SDAVAssetExportSession * wself = self; on line 172 of SDAVAssetExportSession.m.
I had an "unknown error occurred (-12633)" message.
Found the answer to be adding two samples with same timestamp.
Apparently error -12633 is an InvalidTimestamp.
See this SO post -> AVAssetWriter unknown error
If you are using methods insertTimeRanges or insertTimeRange, you need to ensure that the input time ranges are valid. To be more specific, you should not use the asset's duration for this, you need to get the accurate time ranges from individual asset tracks.
Use command ffprobe -show_frames path_to_file to inspect your video files, which sometimes may be very helpful.

Call a two digits phone number with Titanium on ios7

I have to call small phone number with only two digits, when I click on a specific view.
This is working well in Android, but this doesn't work on ios6 and 7. By the way, this is working fine with 3 digits.
This is the function I call on click :
$.callView.addEventListener('click', function(e) {
Ti.Platform.openURL('tel:18');
});
This give me that error :
<Warning>: Ignoring unsafe request to open URL tel:18
<Warning>: LaunchServices: application launch failed - received error code 12
I've seen some pieces of answer in this ticket, but it's not related to Titanium.
I've tried to call Ti.Platform.openURL like that :
tel://18?1
tel:18?1
tel:18#1
tel:+18?1
tel:+18#1
But none of theese things works. Have you an idea of what I have to do to make this call ?
Thanks
You can try appending a pause as in tel:18p. This will show up as 18, which you might not like, but this looks like a long standing issue with Apple, so a fix doesn't appear imminent.

My app crashes if I change the control view repeatedly

I have an app that reads from a database some data ( ASIFormDataRequest ) and some images from server files ( setImageWithURL ). My app does it every time the viewController is changed (in order to have everything updated). So I guess there is an issue with cached images If I push my app to the limit switching viewControllers repeatedly my app crashes. Why is this?
All of this has appeared after adding the setImageWithURL functions. Has anyone run into something similar?
I may have to change the way my app works How do you guys do these calls to the server/SQL? How often?
EDITED:(NON_ANSWERED YET ):
XCODE does not say anything about it , when my device crashes it only displays:
2011-12-29 20:14:56.479 CaeDeCajon[4969:6e4f] arrayProductos.id :13
id_producto: 31 2011-12-29 20:14:56.481 CaeDeCajon[4969:7b5f]
arrayProductos.id :25 id_producto: 15 2011-12-29 20:14:56.490
CaeDeCajon[4969:7b5f] arrayProductos.id :31 id_producto: 15
2011-12-29 20:14:56.491 CaeDeCajon[4969:7b5f] arrayProductos.id :32
id_producto: 15 2011-12-29 20:14:56.395 CaeDeCajon[4969:955f]
arrayProductos.id :22 id_producto: 35 (gdb) // HERE IT STOPS
RUNNING.
for a better understanding of the question, my app is designed as follows:
Based on a 5-icon TabBar.
In the second icon I have a tableview with categories of products ( tables, chairs ... ) and if you press on one of them appears another viewController ( the usual detail view ) showing several products in a row ( thanks to a scrollView ) , here there is a navigationController with a button on it, when pressed it takes you to the gallery mode: showing the same products that were shown in the scrollView but in a gallery mode, if you press one of the products it takes you back to the scrollView and move your screen to the product chosen. Pretty normal stuff .
In the third icon I have the check-out basket, where every product picked up on the scrollView (where there is a buy button ) is pressed.
The case is that I "read" Asycn from the database all the information(no pictures) at launchingWithOptions and every time the viewController is changed, to make sure the user does not pick up a product that was sold out. I implanted this on its own and it seemed to worked fine and not to crash my app ( info : name, stock, ... only strings ). light data.
Here is where I think the problem is: I "read" all the images display from a file system in 1&1 ( hosting compony ), and seems to work fine and fast. The problem is when I swap/change the viewController repeatedly and quick between tableView-ScrollView-galleryMode , it crashed 4 times in a row for the same reason. I must say that I get the images for every viewController, for example the images in the scrollView,galleryMode and checkoutView are the same . Can I reuse them ? because I have calls to the URL everyViewController and I guess that is not healthy.
The code to download images:
NSString *URLphotos =[[NSString alloc]initWithFormat:#"http://www.myurl.com/imagenes/%#",picture1.jpg]; // this is not always picture1.jpg but I changed it for making it plainer.
[cell.photo setImageWithURL:[NSURL URLWithString:URLphotos]
placeholderImage:[UIImage imageNamed:#"placeHolder.png"]] ;
Is it enough? I got no more.
wanted tips:
How/where do you guys "read" the images from the URL in order not to crash the app but have the app updated all the time?
Is there something going on with my cache that is making me crazy ? fix it?
Thanks in advance for the interest
It's not clear if you are using Coredata but I had a similar experience with an app. It also had a tab bar and quickly pressing between items would cause random crashes. The issues was coredata being read / updated / deleted at the same time.
I resolved the issue by moving all of my coredata read, writes and updates to the main thread. (example in Swift):
dispatch_async(dispatch_get_main_queue(), {
myDatabase("NameHere", theCommand: "TRUNCATE", theQuery: "dummy")
})
I made a series of functions for the common coredata commands I needed so your code will of course be different. But try running coredata on the main thread and see if your problem is solved.
If you have a CPU intensive coredata task then you will should not run on the main thread but the complexity of the solution is increased (I have only been using Xcode for 3 months) and someone else may be able to help.
But if you are using coredata try this first to see if it solves your problem.

Resources