I have an older project with a mixed ObjC + Swift codebase. I'm in the process of converting everything to Swift in the hopes that Xcode will work better again when the Codebase is not mixed anymore.
This is an example of the issues I'm currently facing:
The class IVMapViewController is defined in ObjC and the property mapViewModel is declared in the ObjC Header fine. The ObjC Header file is included in the bridging header.
I'm trying to access the property mapViewModel in an swift extension on the same class.
I can actually compile & run the code just fine, but Xcode Autocompletion does not work, and Xcode generates "Phantom" errors in the Issue Navigator (those errors also stay there when a build completes successful)
On the other hand, if I put an actual error in the code, compilation fails, but the actual error will NOT show up in the Issue Navigator. I'll have to dig through the build log to find the actual error.
Am I doing anything wrong? Do I need to adjust some project setting?
Post
Replies
Boosts
Views
Activity
I'm working on an App that still supports iOS 13 and need to fetch some data with CoreData.
This is how I would normally do it
context.perform({
let results = try context.fetch(request)
})
Now with Xcode 13.2 and async/await being available back to iOS 13 I get a compiler error
'perform(schedule:_:)' is only available in iOS 15.0 or newer
Jumping to definition shows the following new API in CoreData
@available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *)
extension NSManagedObjectContext {
public func performAndWait<T>(_ block: () throws -> T) rethrows -> T
public func perform<T>(schedule: NSManagedObjectContext.ScheduledTaskType = .immediate, _ block: @escaping () throws -> T) async rethrows -> T
}
When commenting out the code in the Block, it instead jumps to the old API in CoreData/NSManagedObjectContext
/* asynchronously performs the block on the context's queue. Encapsulates an autorelease pool and a call to processPendingChanges */
@available(iOS 5.0, *)
open func perform(_ block: @escaping () -> Void)
Why does the compiler select the new variant of perform and how can I force it to use the older non-async version?
Hello,
we have a fairly old app that until very recently had iOS 9.3 as minimum deployment target.
After increasing the deployment target to iOS 11, I can no longer open the App on my iPad 2 with iOS 9.3 with an Alert ""App" Is No Lonager Available".
And I can not download the App from the AppStore on iOS 9.3 with an alert "Unable to Purchase - "App" is not compatible with this iPad."
I thought it was supposed to work the way that, when updating the deployment target, users on older OSs can still use and download the last compatible version of the app?
In the AppStore under "Pricing and Availability" -> "Last-Compatible Version Settings", All Versions are checked!
Is there something we have missed?
I'm trying to use UISplitViewController for an iPhone + iPad App.
The Master is a Menu, when one entry is selected, the Detail shows a ViewController for the selected entry.
On iPad, this works as expected.
On iPhone however (and also on iPad in compact width), the first DetailViewController leaks ans is never deallocated.
I've confirmed with the memory graph instrument that on iPad / Regular Width, there is always only 1 instance of DetailViewController alive, but on iPhone / Compact Width there are always 2 instances of DetailViewController alive.
I have put together a minimal sample project that shows this issue here https://github.com/iv-mexx/uisplitviewcontroller-memoryleak