This topic was touched on in the notes for the WWDC 2019 session on Binary Frameworks - I even watched the whole video but it wasn't covered there.It appears I should be able to wrap a static library - one that is created by its own (complex) build scripts - and have iOS, iOS Simulator and macOS versions. Also, that the header files can be included as well.I have been unable to find any information googling around on how one might do this. I would greatly appreciate any pointers to some blog/post that covers this.Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Just had a weird crash in development in Simulator - first of a kind. The crash was on this line:private lazy var regExTrimSet = NSCharacterSet(charactersInString: " \t\r\n_")and the error was some malloc() already released (grrr, should have copied it). Should that be thread safe? [Its being referenced by a bunch of concurrent blocks at one point]Also, I tried to find out where the Xcode console log might get written, but had no luck finding a link. Is there one that this error should be logged to?
Some confusion in my company on this scenario:
current users are on 1.0.0 - have been for months
Apple approves our latest build, say 1.1.0, and we release to the App Store with "Slow Rollout"
a few days later, one of the first 1% reports a serious bug
the dev team immediately fixes the bug, QA approves it, and we upload a new 1.1.1 release the same day
we ask Apple for expedited approval, and that happens in 3 hours
we select "Release 1.1.1 on Slow Rollout" on the App Store.
So what then?
My understanding is that once 1.1.1 is released, since 1.1.0 is the "Official Release", that anyone with auto update turned on will update quickly to 1.1.0, and that then some of those users will be put into the "1.1.1 slow roll out candidate pool)".
Others have opined that I'm wrong - that most users will stay at 1.0.0, and the new 1.1.1 candidate pool will be users on both 1.0.0 and 1.1.0.
Would love to hear someone reply who knows what Apple will really do.
My company wants to be insure that if my Objective-C to Swift conversions fail in anyway, that the app can revert to using the older Objective-C code. By using a remotely controllable flag, the app can switch which code runs as, both are compiled into the app.
Essentially, I create a protocol that describes the original class, then both classes (with a "s" or "o" appended to them) conform to the protocol.
Protocol: Object
Objective-C class: oObject
Swift class: sObject
That said, I hit one issue that I just can't seem reason out. I create a Objective-C function that returns the appropriate class:
Class<Object> classObject(void) {
if (myFlag) {
return [sObject class];
} else {
return [oObject class];
}
}
Swift deals with this really well - I can create an initialized object using:
let object = classObject().init()
but I cannot find a way to do this in Objective-C:
Object *object = [[classSalesForceData() alloc] init];
fails with "No known class method for selector 'alloc'"
Is there a way to do this?
David
PS: my workaround is to return an allocated object:
Object *createObject(void) {
if (myFlag) {
return [sObject alloc];
} else {
return [oObject alloc];
}
}
I searched online didn't find anything.
David
Topic:
Developer Tools & Services
SubTopic:
Xcode
I read that since iOS13 its possible to read an external drive connected via the Lightning port.
Is it possible to read files from myApp? If so how.
Thanks!
My company's app uses the following code to look for services advertised by a Garmin VIRB 360 camera (now discontinued and unsupported).
In the past this code has worked fine. However, on my iPhone 12 Pro Max running iOS 15.0.2 it returns no services.
let serviceBrowser = NetServiceBrowser()
serviceBrowser.searchForServices(ofType: "_garmin-virb._tcp.", inDomain: "local.")
Did something change in iOS 15? Do I need some entitlement? Is the format of the strings incorrect?
My recollection is that the strings are from Garmin document (but its years old).
Any help greatly appreciated!
In my case there are three interfaces. I had a mental model that I now believe is incorrect.
If any of the 3 interfaces is "satisfied", then I get one message telling me so. I guess if that one interface goes down, then I should get a second message that tells me that (this is hard to test as Xcode keeps disconnecting from my device when I switch to Settings to change things).
in my case, wifi and cellular are both on. I launch the app, get notified that wifi is satisfied, but nothing on cellular.
So my guess is there is a hierarchy: wired, wifi, and cellular. If the highest priority path is available, the others are assumed "off" since you have a path. Thus, you will never get "satisfied" for more than one path.
Correct?
I read today in the Swift book:__weak typeof(self) weakSelf = self;
self.block = ^{
__strong typeof(self) strongSelf = weakSelf;
[strongSelf doSomething];
}
// Excerpt From: Apple Inc. “Using Swift with Cocoa and Objective-C (Swift 3.1).”When I saw '__strong' I got a bit concerned - in the past I had always used "typeof(self) strongSelf = weakSelf;, think the typeof made strongSelf strong.Yikes! Did I get it wrong all these years???
What I'd like to do is provide a CVPixelBuffer as the dataInfo argument to CGDataProviderCreateWithData that has an initializer:init?(dataInfo info: UnsafeMutableRawPointer?,
data: UnsafeRawPointer,
size: Int,
releaseData: @escaping CGDataProviderReleaseDataCallback)My best (and probably wrong) approach to convert to a UnsafeRawPointer is:let pixelBuffer: CVPixelBuffer
...
let ptr: UnsafeMutableRawPointer = UnsafeMutableRawPointer(mutating: &pixelBuffer)However, the releaseData callback function is defined as:typealias CGDataProviderReleaseDataCallback = (UnsafeMutableRawPointer?, UnsafeRawPointer, Int) -> VoidI cannot think of any way to get the CVPixelBuffer back from the UnsafeMutableRawPointer. Clearly I need help!
Combine has two related functions that support "demand", where Subscribers inform Publishers on the desired number of elements passed to them in a "receive" function. The below ignores infinite demand.1) func request(_ demand: Subscribers.Demand)Subscriptions provide this function, and as the Apple Docs say:"Tells a publisher that it may send more values to the subscriber."Matt Gallagher supposes in his excellent 22 Combine Tests article that each of these demands should be additive, and when the Subscription sends elements to the Subscriber, it decrements the count.2) func receive(_ input: Self.Input) -> Subscribers.DemandWhen a Subscriber receives data, it returns another demand, which the Apple docs state is:"A Subscribers.Demand instance indicating how many more elements the subscriber expects to receive."I have seen various interpretations on how these numbers relate, and I of course have my own that I'll postulate here.---A Publisher has a one element, and it gets a 'request(.max(10))' When it sends that to the Subscriber, and the return demand should be '.max(9)', a reminder to the Publisher (actually a Subscription created by the Publisher) that its expecting 9 more elements.If for some reason the Subscriber decides to send in another request for .max(10), and the Publisher gets one more element, and messages the Subscriber with that one element, the return will then be .max(18), meaning, Subscriber wanted 10, then it wanted 10 more, but it has only received 2.Alternate interpretations seem to be that the return from receive is additive to the running total. So any number other than 0 will increase what the Publisher can send.Would be super if anyone in the know could help clarify!!!
We had working code a few years ago, for a seldom used feature (streaming the camera image from a VIRB 360 camera).
Trying to get it working again, but when I use a URLSession Data task to try and connect to this URL:
rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=0
I get an error: Code=-1002 "unsupported URL"
I vaguely remember trying to add permissions in the Info.plist for the local network, but it turned out for "http" we didn't need .t (so it got removed).
But now I can't find a reference to it.
Does the above error code look like its related to permissions? If not what?
Thanks for any pointers!
David
Have an app with Storyboards that use a few customer fonts (Poppins and FontAwesome). No issues at all in Xcode 14.
Updated to Xcode 15, and can build clean and run no issues reported. But many of the buttons and labels have the incorrect custom Font assigned - instead of FontAwesome, the get assigned Poppin. In a few cases FontAwesome is used, but the incorrect weight (I log the button font in awakeFromNib.
I've looked at the Storyboard XML, it looks fine, and if I set the font to some system font all works fine. Setting it to a system font, then back to FontAwesome does not fix anything, and the XML looks identical to what it was before.
I'm at a total loss as to what to do next. Any suggestions most appreciated.
PS: in awakeFromNib, I can set the font to the correct FontAwsome font, and the control shows as it should. So the font works from code, not from the Storyboard.
Have an app in the store - 10K users. Using the same algorithm for years to download objects, convert them to ManagedObjects, then save them in a context.
Been using the exact same Objective-C code for over 5 years - no changes.
We build the app with Xcode 15.1, release it a few weeks ago, then slowly start getting reports of the app won't boot.
Run the app in 15.1, look at memory usage, and it's a flat line up. But the code is littered with autorelease statements. For this download, max memory was 2.3G! No wonder so many users crashing!
[Worked two weekends straight to get this fixed, but why did it happen???]
The last developer told me he added those to reduce memory pressure, and that they worked for him. (Unfortunately no old memory usage graphs).
But look at the attached image - memory usage increments in a straight line - no saw tooth where memory would get released.
Oh, and this is in one runloop on the main thread (don't blame me, I didn't write the original code!):
User is using my app, the goes to System Settings, and changes some of my App's settings (switches, text fields, etc).
Does the system send my app any kind of notification?
David
PS: I tried all kinds of searches on this and found nothing.
Topic:
App & System Services
SubTopic:
Notifications