Posts

Post not yet marked as solved
3 Replies
1k Views
Hi, Inside a Mac Catalyst app, I need to display a popover starting from an NSToolbarItem contained inside the app toolbar (like the Apple Maps Mac app does, see below image). In order to do that, when I press the button I need to find the toolbar item view and use it as popover anchor. How can I find the view or frame of an NSToolbarItem on Mac Catalyst? A property that could help me is the NSToolbarItem "view" property (NSView), but that property has been marked has unavailable in Mac Catalyst. Any idea? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
2 Replies
619 Views
Is it possible to use a string catalog to localize a settings bundle? Currently, to localize a Settings.bundle, we need to create a folder for each language with a single strings file inside. For example: Settings.bundle en.lproj > Root.strings fr.lproj > Root.strings de.lproj > Root.strings ... Any way to convert that to a string catalog? Thank you
Posted
by DaleOne.
Last updated
.
Post marked as solved
1 Replies
279 Views
Just found something weird with the String(localized:) method. Let's say that I have a "%lld apples" sentence inside a string catalog. If I call String(localized:"\(1000) apples") when on the device settings the number format is "1'234'567.89" and the device language is English, then the following string is returned: 1\'000 apples Any idea why the ' character has a backslash? It's a bug or I miss something? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
0 Replies
250 Views
When using storyboards, string catalogs automatically grab translation comments from the "Localizer Hint" attribute of the objects in the storyboard. The problem is that we can only specify a single comment per object. What if we need to specify a specific comment for some of the attributes of the object? For example, I often need to provide a specific comment to each segment title of segmented control objects. Currently, I'm doing that by setting the managed property of each string to "Manual" and setting the comment directly from the string catalog. There is a better way to handle these cases?
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
1 Replies
1.3k Views
Hi, Just want to understand what is the current state of iOS 15 prewarming app delegate behaviour. There is a lot of confusion (and a lack of documentation) about which app delegate methods are called during prewarming. It's not clear if didFinishLaunchingWithOptions will be called or not during prewarming. A lot of applications are counting on UserDefaults and Keychain access in didFinishLaunchingWithOptions, but sadly these two features seems to be unavailable during prewarming causing issues. Some users say that this was the case before 15.4 and that from 15.4 the didFinishLaunchingWithOptions app delegate method is no more called during prewarming. Just want to know if we can have an official statement about this. It is safe, from iOS 15.4 onwards, to use UserDefaults and access Keychain in the didFinishLaunchingWithOptions app delegate method? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
2 Replies
471 Views
I’m exploring the new Xcode 15 string catalog feature. I see that for every sentence there is a “screenshots” field in the Xcode inspector (see image). How can we populate this field? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
6 Replies
4.7k Views
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
Posted
by DaleOne.
Last updated
.
Post marked as solved
1 Replies
679 Views
Hi, I have a controlled contained in a split view controller primary controller with a UISearchController assigned in navigationItem.searchController. On iPhone the search bar is directly displayed in the navigation bar. This is want I want. But on iPad, the search bar is hidden and a search button is displayed in the top right of the navigation bar. In order to display the search bar the user must click on the icon to display the search bar. I want the search bar to always be visible, like on iPhone. How can I achieve that? This is the code I use to include the UISearchController: let searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.obscuresBackgroundDuringPresentation = false searchController.hidesNavigationBarDuringPresentation = false navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false And this is the result on both devices: Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
7 Replies
2.1k Views
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
Posted
by DaleOne.
Last updated
.
Post marked as solved
1 Replies
768 Views
I have an entity named Image with a binary attribute named imageData. I need to cycle trough all Image objects and do something with the data contained inside the imageData attribute. This is the code: for image in managedObjectContext.allImages { autoreleasepool { var imageData = image.imageData } } I have a lot of objects and every imageData has something like 500KB of data for a total of 3GB of data. The problem is that each time the imageData attribute is used, the data go into memory and not released until the loop is done. This is causing the memory to grow up to 3GB crashing the app. I also tried to turn the object into a fault when I'm done with it by calling refresh(_:mergeChanges:) but nothing changes: for image in managedObjectContext.allImages { autoreleasepool { var imageData = image.imageData managedObjectContext.refresh(image, mergeChanges: false) } } How can I cycle trough all objects without filling up all the memory? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
0 Replies
564 Views
In a Core Data store I have a binary data attribute with “Allows External Storage” set to true. Everything work as expected, i.e. the data of this attribute is saved inside the _EXTERNAL_DATA folder. For every data stored into that attribute, a file is created inside _EXTERNAL_DATA with a UUID as file name and without extension. That's expected. For some reason the _EXTERNAL_DATA folder of a particular user was full of files with an “.interim” extension. Somebody know what are this files? In which cases files are saved with the ".interim" extension? Do we need to do anything with these files? Can they be deleted? Thank you
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
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
Posted
by DaleOne.
Last updated
.
Post marked as solved
4 Replies
1.7k Views
Hi, I have a UITextView with allowsEditingTextAttributes set to true. On iOS 15 and before, users can select part of the text and tap on the BIU button in order to set the text to bold, italic or underline. On iOS 16 the BIU button is missing. How can the user change the formatting of the text contained inside an UITextView on iOS 16? There is something I need to specify on UITextView? Thank you
Posted
by DaleOne.
Last updated
.
Post marked as solved
5 Replies
3.4k Views
Hi, I am faced with a strange problem with a Catalyst app that uses MapKit. If the map is visible and I resize the window (causing the map the resize), sometime the app crashes with some Metal related error. Is this a know issue between MapKit and Catalyst? There is something I can do in order to prevent this crash? Below you can find the error message and a screenshot of the thread that caused the crash. Thank you -[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:2951: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x7f96de27f600 (label: <no label set>): <MTLToolsObject: 0x7f96dde552e0> -> <BronzeMtlTexture: 0x7f96dc04c230> label = <none> textureType = MTLTextureType2D pixelFormat = MTLPixelFormatBGRA8Unorm_sRGB width = 2372 height = 1668 depth = 1 arrayLength = 1 mipmapLevelCount = 1 sampleCount = 1 cpuCacheMode = MTLCPUCacheModeDefaultCache storageMode = MTLStorageModeManaged hazardTrackingMode = MTLHazardTrackingModeTracked resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeManaged MTLResourceHazardTrackingModeTracked usage = MTLTextureUsageShaderRead MTLTextureUsageRenderTarget shareable = 0 framebufferOnly = 0 purgeableState = MTLPurgeableStateNonVolatile swizzle = [MTLTextureSwizzleRed, MTLTextureSwizzleGreen, MTLTextureSwizzleBlue, MTLTextureSwizzleAlpha] isCompressed = 0 parentTexture = <null> parentRelativeLevel = 0 parentRelativeSlice = 0 buffer = <null> bufferOffset = 0 bufferBytesPerRow = 0 iosurface = 0x0 iosurfacePlane = 0 allowGPUOptimizedContents = YES'
Posted
by DaleOne.
Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
Hi, I'm looking for a way to do something when the user presses the window red close button on a Catalyst app. For example, in some cases, I need to display an alert and prevent the window from closing. On AppKit we can use the windowShouldClose delegate method of NSWindowDelegate. Unfortnuately this is not available on Catalyst. Did someone found a way on Catalyst to prevent a window from closing? Maybe there is a way to expose the AppKit NSWindowDelegate object? Thank you
Posted
by DaleOne.
Last updated
.