Hi!I have a model with an antity that have a property that use the "Allows External Storage" option. For some reason the framework does not handle the files inside this directory correctly when some of the files have the SAME data.Basically the issue is:- You have an entity with a binary property that use the “Allows External Storage” option.- You create some entities and for every entities you put the same data in the binary property.- After saving Core Data will create inside the _EXTERNAL_DATA folder a file for every entity data.- You delete all the entities from the store.- Core Data will delete only a single file and all the other files are left in the directory forever.So if you create for example 10 identical entities (same data) with 1MB of data for every entity, after deleting all the entities from the store your _EXTERNAL_DATA folder will still contain 9MB of orphaned data that will stay there forever. 😟This bug is present in iOS 7, iOS 8 and iOS 9 beta 5.I have made a sample project that illustrate this behavior:http://www.dale1.ch/documents/delete_external_data_sample_project.zipI have filled a bug report (18319761) the 12 September 2014 with all the informations needed to reproduce the issue but unfortunally is still Open and I didn't received any feedback from Apple.Alan
Post
Replies
Boosts
Views
Activity
Hi!I currently developing a mobile website and found that Safari on iOS has some problems setting the focus on inputs when they are inside an iframe.When in a page you have many inputs you can tap on a field and then use the next / previous buttons on the keyboard to navigate between the fields. When the focus move to another input Safari scroll automatically the page centering the field in the page. This is great and works well.The problem is when the fields are inside a page of an iframe. In this case when you change focus from one field to another Safari has some kind of issue; the page “bounce” and the focused field is not centered in the page.I have made a video of a simple page that has this issue. In the first part of the video the page without the iframe is loaded and the focus works correctly. In the second part the page with the iframe is loaded and the issue is visible.http://www.dale1.ch/documents/safari_iframe_focus_issue.movThe code of the first page (testinput.html) where the focus is correctly handled is this:<!DOCTYPE html>
<html>
<head>
<title>Test input</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
</head>
<body>
<div><span>Input 1: </span><input type="text" tabindex="1" /></div>
<div><span>Input 2: </span><input type="text" tabindex="2" /></div>
<div><span>Input 3: </span><input type="text" tabindex="3" /></div>
<div><span>Input 4: </span><input type="text" tabindex="4" /></div>
<div><span>Input 5: </span><input type="text" tabindex="5" /></div>
<div><span>Input 6: </span><input type="text" tabindex="6" /></div>
<div><span>Input 7: </span><input type="text" tabindex="7" /></div>
<div><span>Input 8: </span><input type="text" tabindex="8" /></div>
<div><span>Input 9: </span><input type="text" tabindex="9" /></div>
<div><span>Input 10: </span><input type="text" tabindex="10" /></div>
<div><span>Input 11: </span><input type="text" tabindex="11" /></div>
<div><span>Input 12: </span><input type="text" tabindex="12" /></div>
<div><span>Input 13: </span><input type="text" tabindex="13" /></div>
<div><span>Input 14: </span><input type="text" tabindex="14" /></div>
<div><span>Input 15: </span><input type="text" tabindex="15" /></div>
<div><span>Input 16: </span><input type="text" tabindex="16" /></div>
<div><span>Input 17: </span><input type="text" tabindex="17" /></div>
<div><span>Input 18: </span><input type="text" tabindex="18" /></div>
<div><span>Input 19: </span><input type="text" tabindex="19" /></div>
<div><span>Input 20: </span><input type="text" tabindex="20" /></div>
<div><span>Input 21: </span><input type="text" tabindex="21" /></div>
<div><span>Input 22: </span><input type="text" tabindex="22" /></div>
<div><span>Input 23: </span><input type="text" tabindex="23" /></div>
<div><span>Input 24: </span><input type="text" tabindex="24" /></div>
<div><span>Input 25: </span><input type="text" tabindex="25" /></div>
<div><span>Input 26: </span><input type="text" tabindex="26" /></div>
<div><span>Input 27: </span><input type="text" tabindex="27" /></div>
<div><span>Input 28: </span><input type="text" tabindex="28" /></div>
</body>
</html>This is the code of the page that has the issue (testinput_iframe.html):<!DOCTYPE html>
<html>
<head>
<title>Test input</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
</head>
<body>
<iframe src="/testinput.html" />
</body>
</html>The issue is present in Safari on the iPhone, iPad and the xCode Simulator from version 8.4 to version 9.2.Someone know if this is a bug? There is way to fix it in css or javascript?Thanks and sorry for my english! 😉
Hi!I’m currently developing an app with MapKit on iOS 11 and I’m using the new annotation clustering feature.At some point I need to find all the cluster annotations currently visible on the map.I tried iterating trough the mapView.annotations array and looking for annotations that are MKClusterAnnotation. The problem is that it seems that the annotations array does not only contain the currently visible clusters but also other clusters, probably the clusters created in the past. For this reason I cannot know which clusters are currently visible and which are not.You can reproduce this by adding some annotations on a map, zoom out the map so that the annotations start to group together and then zoom in the map so that the annotations become ungrouped until no more clusters are visible on the map. If you look in the map annotations array you will still find many cluster annotations.Someone know how I can get only the list of the cluster objects (MKClusterAnnotation) that are currently visible on the map?Thank youAlan
Hi!I noticed a strange behavior on MapKit when using the iOS 11 clustering feature.If you add some annotations on a map (with same clusteringIdentifier and same displayPriority) MapKit will correctly merge together annotations that are close.The problem is that if you remove all the annotations and then you add them back the map will no more merge the annotation together. It’s like the clustering feature simply stop working.I don’t really know if it is a bug or if I miss something.Someone else have noticed this?Alan
Hi!I have an issue using the hidesBottomBarWhenPushed attribute on the iPhone X.If I set this attribute to true, when I push another controller on the iPhone X the toolbar is moving down during the animation. This is appening only on the iPhone X.I have made a video that show this behaviour. At the beginning you see the effect on a iPhone 8 and then on the iPhone X.http://www.dale1.ch/documents/hides-bottom-bar-when-pushed.movSomeone know a way to stop the toolbar from moving down during the animation?Thank youAlan
Hi!Prior to iOS 13 it was possible to change the color of the text (+ and -) of a UIStepper by setting the desired color in the tintColor attribute.Unfortunately in iOS 13 (beta 7) this no longer works and the text color is always black.Has anyone found a way to change the stepper text color?Thank youAlan
Hi!I hope someone can help me.A user told me that my app crashes when scrolling a tableView on iOS 13.1.2.I received the crash log and the error it’s just crazy.The crash log indicate that the error is at the first line inside the trailingSwipeActionsConfigurationForRowAt method.override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
guard items.count > indexPath.row else {return nil} //This line crash.
…
}The items property is defined as:private var items = [AnyObject]()The error is EXC_BREAKPOINT (SIGTRAP).How can this line of code crash? items is a non optional variable and indexPath is also a non optional struct.It's as if indexPath.row was deliberately creating an EXC_BREAKPOINT exception. It is possible?Another strange thing is that the user say that the app crash during scrolling. It seems that the method trailingSwipeActionsConfigurationForRowAt is called during scroll. That's also strange, it should not be called only when the user does a left swipe? Maybe it has something to do with some accessibility feature because in the call stack of crash report I see some system accessibility methods calls (see crash report below).Has anyone any ideas that can help me or has encountered a similar problem?Thank youException Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001de522a94
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [1431]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libswiftUIKit.dylib 0x00000001de522a94 $s10Foundation9IndexPathV5UIKitE7sectionSivgTm + 52
1 libswiftUIKit.dylib 0x00000001de522a78 $s10Foundation9IndexPathV5UIKitE7sectionSivgTm + 24
2 MYAPP 0x000000010219ca4c specialized GroupTableViewController.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 272 (GroupTableViewController.swift:714)
3 MYAPP 0x0000000102194544 @objc GroupTableViewController.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 136 (:0)
4 UIKitCore 0x00000001ad6ae200 -[UITableView _trailingSwipeConfigurationAtIndexPath:fromRemoveButton:] + 2140 (UITableView.m:16580)
5 UIKit 0x00000001de7889f0 -[UITableViewCellAccessibility _privateAccessibilityCustomActions] + 544 (UITableViewCellAccessibility.m:3153)
6 UIAccessibility 0x00000001b49e6228 -[NSObject(AXPrivCategory) _retrieveCustomActionsForElement:] + 72 (NSObjectAccessibility.m:2973)
7 UIAccessibility 0x00000001b49e650c -[NSObject(AXPrivCategory) _accessibilityCustomActions] + 260 (NSObjectAccessibility.m:3021)
8 UIAccessibility 0x00000001b49e9978 -[NSObject(AXPrivCategory) _accessibilityCustomActionNamesAndIdentifiers] + 68 (NSObjectAccessibility.m:3683)
9 UIAccessibility 0x00000001b49f07bc -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 6580 (NSObjectAccessibility.m:6542)
10 UIAccessibility 0x00000001b49d1d9c _copyMultipleAttributeValuesCallback + 544 (UIAccessibilityRuntime.m:344)
11 AXRuntime 0x00000001b39fc834 ___AXXMIGCopyMultipleAttributeValues_block_invoke + 64 (AccessibilityPriv.m:1192)
12 AXRuntime 0x00000001b39fc3a8 _handleNonMainThreadCallback + 68 (AccessibilityPriv.m:467)
13 AXRuntime 0x00000001b39fc6b8 _AXXMIGCopyMultipleAttributeValues + 304 (AccessibilityPriv.m:1191)
14 AXRuntime 0x00000001b39f658c _XCopyMultipleAttributeValues + 396 (AccessibilityClientDefsServer.c:1354)
15 AXRuntime 0x00000001b3a0bd28 mshMIGPerform + 272 (MachServerHelper.c:447)
16 CoreFoundation 0x00000001a939d91c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1937)
17 CoreFoundation 0x00000001a939cfe8 __CFRunLoopDoSource1 + 448 (CFRunLoop.c:2075)
18 CoreFoundation 0x00000001a9397c20 __CFRunLoopRun + 2144 (CFRunLoop.c:3098)
19 CoreFoundation 0x00000001a9397098 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
20 GraphicsServices 0x00000001b3501534 GSEventRunModal + 108 (GSEvent.c:2246)
21 UIKitCore 0x00000001ad4b77ac UIApplicationMain + 1940 (UIApplication.m:4753)
22 MYAPP 0x000000010209cae8 main + 68 (PlaceViewController.swift:25)
23 libdyld.dylib 0x00000001a9216f30 start + 4
Hi!Currently I can check if a device is able to encode HEIC with the following code:func heicEncodingSupported() -> Bool {
let supportedTypes = CGImageDestinationCopyTypeIdentifiers() as NSArray
return supportedTypes.contains(AVFileType.heic)
}
//This return false on an iPhone SE.But how can I check if a device is able to decode HEIC?For example my iPhone SE is not able to encode HEIC but is able to decode it by loading HEIC data inside an UIImage object.var heicImage = UIImage(data:heicData)
//This will correctly load the image on an iPhone SE.Is it correct to say that all devices that support iOS11 are able to decode HEIC data?Or there is a way to check if the device is really able to decode HEIC data?Thank you
Hi!In one of my app I need to control the color of the status bar (need to be white).For doing this I have added the UIViewControllerBasedStatusBarAppearance = true in Info.plist and overrided the preferredStatusBarStyle property of the view controllers / navigation controllers to lightContent.Everything works properly except one thing. If I request a biometric authentication via LAContext.evaluatePolicy when the Touch ID dialog is displayed the status bar color change to black.You can see the behaviour in the below image. Before the Touch ID message is displayed the status bar is white but when the message appear it become black.https://www.dale1.ch/documents/status-bar-authentication-dialog.pngSomeone know how to keep the status bar white even when the Touch ID request message is displayed?Unfortunately I cannot set the UIViewControllerBasedStatusBarAppearance attribute to false.Thank youAlan
Hi!I found a situation where a split view controller on iOS 13 never let the controller displayed in the detail to dealloc.The problem is reproducible with the standard Xcode “Master-Detail App” project template.This is how you can reproduce the problem:In Xcode create a new “Master-Detail App” project.In “DetailViewController” add a deinit method and print something.Run the project on a device that allows you to switch from a compact split view to an expanded split view (for example the iPhone 8 Plus).Set the device to portrait.If you choose an item on the master list the detail is loaded and you will see that the previously controller that was present on the detail is deallocated. That’s correct.Now rotate the device to landscape to expand the split view.Choose an item in the master. The controller will be displayed on the detail.Rotate the device to portrait. The split view will collapse.Tap on the back arrow (that for some strange reason on iOS 13 will no more display the title but only the arrow icon, but that’s another problem).Choose another item on the master.The previous controller will never be deallocated and will stay in memory forever.If you try the same thing on iOS 12 you will see that everything is working as expected.Had any of you already noticed this? If yes, have you found a way to fix the problem?Thank youAlan
Hi!I have the "-com.apple.CoreData.ConcurrencyDebug 1" argument set in the schema to check if I have some CoreData concurrency problems.I don't know why but this code give me an Multithreading_Violation_AllThatIsLeftToUsIsHonor error.Do you think I did something wrong with this code?private func loadSigns(searchTerm: String) {
let privateMOC = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
privateMOC.parent = managedObjectContext
let fetchRequest: NSFetchRequest = Sign.fetchRequest()
let predicate = NSPredicate(format: "name CONTAINS[cd] %@", searchTerm, 0)
fetchRequest.predicate = predicate
let sortDescriptor = NSSortDescriptor(key: "name", ascending: true)
fetchRequest.sortDescriptors = [sortDescriptor]
let asynchronousFetchRequest = NSAsynchronousFetchRequest(fetchRequest: fetchRequest) {(result:NSAsynchronousFetchResult!) -> Void in
print("request done")
}
do {
_ = try privateMOC.execute(asynchronousFetchRequest) as? NSPersistentStoreAsynchronousResult
} catch {
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}I also tried to incapsulate the code inside the perform method of the privateMOC but I still have the Multithreading_Violation_AllThatIsLeftToUsIsHonor error:private func loadSigns(searchTerm: String) {
let privateMOC = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
privateMOC.parent = managedObjectContext
privateMOC.perform {
let fetchRequest: NSFetchRequest = Sign.fetchRequest()
let predicate = NSPredicate(format: "name CONTAINS[cd] %@", searchTerm, 0)
fetchRequest.predicate = predicate
let sortDescriptor = NSSortDescriptor(key: "name", ascending: true)
fetchRequest.sortDescriptors = [sortDescriptor]
let asynchronousFetchRequest = NSAsynchronousFetchRequest(fetchRequest: fetchRequest) {(result:NSAsynchronousFetchResult!) -> Void in
print("request done")
}
do {
_ = try privateMOC.execute(asynchronousFetchRequest) as? NSPersistentStoreAsynchronousResult
} catch {
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}Any idea?Thank you
Hi!
On iOS 14 a UISplitViewController inside my app has stopped calling some of its delegate methods.
For example on iOS 13 the delegate method collapseSecondaryOntoPrimaryViewController is correctly called when needed.
On iOS 14 this method is not called and this message is printed on the output:
[UISplitViewController] Skipping delegate calllback, splitViewController:collapseSecondaryViewController:ontoPrimaryViewController:. Unsupported for UISplitViewController style DoubleColumn
Can someone help me?
I'm using Xcode 12 beta 3 (12A8169g).
Thank you
Alan
Hi,
I'm testing one of my app on iOS 14 with Xcode 12 beta 3 (12A8169g) and I have a problem with my storyboards.
Xcode give me this error for all the storyboards that contain a split view controller:
An internal error occurred. Editing functionality may be limited.
The log generated by the Xcode "Report a bug" button say:
Exception name: NSInvalidArgumentException
Exception reason: UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column
It worked correctly on Xcode 12 beta 2.
Has anyone encountered the same problem and found a way to fix it?
Thank you
Hi,
I'm learning SwiftUI and there are still some things I don't understand very well.
For example, this is compiling correctly:
struct Test: View {
private var testPrivateProperty = 1
var body: some View {
Text("Test")
}
}
struct Test_Previews: PreviewProvider {
static var previews: some View {
Test()
}
}
This is also compiling correctly:
struct Test: View {
@Binding var testBinding: Bool
var body: some View {
Text("Test")
}
}
struct Test_Previews: PreviewProvider {
static var previews: some View {
Test(testBinding: .constant(true))
}
}
But if I create a View that contain both a binding and a private property:
struct Test: View {
@Binding var testBinding: Bool
		private var testPrivateProperty = 1
var body: some View {
Text("Test")
}
}
struct Test_Previews: PreviewProvider {
static var previews: some View {
Test(testBinding: .constant(true))
				//Error on the line above.
}
}
the compiler produce this error:
'Test' initializer is inaccessible due to 'private' protection level Can anyone help me understand why?
Thank you
Hi,
Sorry for the long post but I have an issue with SwiftUI that is driving me crazy.
Let's take this example view:
struct TestNumberPicker: View {
	 @State private var number = UserDefaults.standard.integer(forKey: "number")
	 var body: some View {
			VStack {
				 Stepper("Number", value: $number, in: 0...240, step: 5)
				 Text("Selected number: \(number)")
			}
			.onChange(of: number, perform: { newNumber in
				 UserDefaults.standard.setValue(newNumber, forKey: "number")
			})
	 }
}
The view has a state variable named "number" initialized with a value readed from the UserDefaults. This variable is linked to a Stepper. When the value of "number" is changed a block is executed to save the new value in the UserDefaults.
Now, this works correctly if for example this view is presented modally but it doesn't work anymore if the view is presented via a NavigationLink, like this:
struct TestForm: View {
	 var body: some View {
			NavigationView {
				 Form {
						NavigationLink("Pick a number", destination: TestNumberPicker())
				 }
				 .navigationBarTitle(Text("Test"), displayMode: .inline)
			}
	 }
}
The first time the view is displayed everything work as expected but if I tap on back and I select again the NavigationLink something weird appends. The "number" variable is reset to the original value.
This is an example: I tap on the navigation item.
The view is displayed.
The "number" variable is initialised with 10 (read from the UserDefaults).
I tap once on the stepper (+).
The "number" variable become 15.
The view is displaying "Selected number: 15"
The UserDefaults save 15 (confirmed by reading the plist file).
I tab on back.
I tap again on the NavigationItem.
The view is displayed but the "number" variable contain 10 instead of 15!
I believe the problem has to do with NavigationLink not lazy loading the view. In fact if I forces the view to load lazy:
struct TestForm: View {
	 struct LazyView<Content: View>: View {
			let build: () -> Content
			init(_ build: @autoclosure @escaping () -> Content) {
				 self.build = build
			}
			var body: Content {
				 build()
			}
	 }
	 var body: some View {
			NavigationView {
				 Form {
						NavigationLink("Pick a number", destination: LazyView(TestNumberPicker()))
				 }
				 .navigationBarTitle(Text("Test"), displayMode: .inline)
			}
	 }
then everything work as expected.
What is exactly the problem?
It is something I'm doing wrong?
Thank you