Post

Replies

Boosts

Views

Activity

Comment on How to deduce from NSMethodSignature that a struct argument is passed by pointer?
@eskimo Thanks! I found the section you are referring here https://github.com/ARM-software/abi-aa/blob/320a56971fdcba282b7001cf4b84abb4fd993131/aapcs64/aapcs64.rst#642parameter-passing-rules. I think that I understand now why CMTime is encoded as a pointer. Not because it is passed on the stack but because it falls under the C.8 rule. I still curious if I can get this info from the runtime without the need to implement these rules myself.
Jan ’22
Comment on How to deduce from NSMethodSignature that a struct argument is passed by pointer?
Thank you for the effort. I am using OCMock mocking library in tests and recently started running our test suit on arm64. On this arch the library cause stack corruption with some of our tests. How? When a stub is created, it stores the NSInvocation. Instead of retaining it's arguments with the [NSInvocation retianArguments] they decided to implement their own retaining method The retaining method does not handle a situation when a struct needs to be copied from the stack, probably because struct arguments becoming pointers was not a thing in x86_64. I want to fix this by storing the argument somewhere and then using the stored argument when matching the invocation against an actual call. For this I need to identify arguments which needs to be copied (or copy everything, which I will probably do if I don't find a solution).
Jan ’22
Comment on How to deduce from NSMethodSignature that a struct argument is passed by pointer?
Their documentation: Don't do a regular -retainArguments on the invocation that we use for matching. NSInvocation effectively does an strcpy on char* arguments which messes up matching them literally and blows up with anyPointer (in strlen since it's not actually a C string). Also on the off-chance that anInvocation contains self as an argument, -retainArguments would create a retain cycle. Note that anyPointer is an OCMock specific term.
Jan ’22
Comment on Can't manage my sandbox account
For anyone reading this, there is a real workaround buried under the pile of replies. Don't give up and continue reading. I really wish Apple would edit their message and put it there so it will be visible. TL;DR: The issue for many users is that they are using TestFlight/personal iCloud account and not "Sandbox account" as the Sandbox account.
Topic: App & System Services SubTopic: StoreKit Tags:
Feb ’24
Comment on How to write AVAudioBuffer to a file?
Thanks. Indeed it is always AVAudioPCMBuffer as far as I have tried. I wander why they did not reflect this in the signature of the callback though.
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Sep ’21
Comment on Widget Extension Jetsamming when Loading SVG Images
Ooof now it seems that it works for some assets, but other assets cause memory spikes even after conversion to PDF.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Comment on Is it safe to put AVAudioSession calls not on main thread?
Thanks for your answer. This might be a stupid question since the documentation does not explicitly forbid it, but I just want to make sure, would it be ok to call setCategory:error: on an arbitrary thread?
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Jan ’22
Comment on How to deduce from NSMethodSignature that a struct argument is passed by pointer?
@eskimo Thanks! I found the section you are referring here https://github.com/ARM-software/abi-aa/blob/320a56971fdcba282b7001cf4b84abb4fd993131/aapcs64/aapcs64.rst#642parameter-passing-rules. I think that I understand now why CMTime is encoded as a pointer. Not because it is passed on the stack but because it falls under the C.8 rule. I still curious if I can get this info from the runtime without the need to implement these rules myself.
Replies
Boosts
Views
Activity
Jan ’22
Comment on How to deduce from NSMethodSignature that a struct argument is passed by pointer?
Thank you for the effort. I am using OCMock mocking library in tests and recently started running our test suit on arm64. On this arch the library cause stack corruption with some of our tests. How? When a stub is created, it stores the NSInvocation. Instead of retaining it's arguments with the [NSInvocation retianArguments] they decided to implement their own retaining method The retaining method does not handle a situation when a struct needs to be copied from the stack, probably because struct arguments becoming pointers was not a thing in x86_64. I want to fix this by storing the argument somewhere and then using the stored argument when matching the invocation against an actual call. For this I need to identify arguments which needs to be copied (or copy everything, which I will probably do if I don't find a solution).
Replies
Boosts
Views
Activity
Jan ’22
Comment on How to deduce from NSMethodSignature that a struct argument is passed by pointer?
Their documentation: Don't do a regular -retainArguments on the invocation that we use for matching. NSInvocation effectively does an strcpy on char* arguments which messes up matching them literally and blows up with anyPointer (in strlen since it's not actually a C string). Also on the off-chance that anInvocation contains self as an argument, -retainArguments would create a retain cycle. Note that anyPointer is an OCMock specific term.
Replies
Boosts
Views
Activity
Jan ’22
Comment on Is it possible to obtain the clipping path of CGContext?
Not a polygon intersection as CGPath is not a polygon. There is actually a third party library that does this, but I was hoping to find a solution with using only the standard libraries Apple provide (since Core Graphics already have to perform this intersection under the hood).
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Aug ’22
Comment on How do the run loop of the main thread and the main queue are related?
Thanks! It's more of a questing for understanding how it works rather than solving a specific problem. "Foundation’s run loop code has special logic so that the main thread’s run loop drains any blocks that were dispatched to the main queue." Do you know where I can read more about this?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’23
Comment on Can't manage my sandbox account
For anyone reading this, there is a real workaround buried under the pile of replies. Don't give up and continue reading. I really wish Apple would edit their message and put it there so it will be visible. TL;DR: The issue for many users is that they are using TestFlight/personal iCloud account and not "Sandbox account" as the Sandbox account.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Feb ’24
Comment on How to make changes of text in search filed to cause animated changes in the view?
Thanks, adding it with the value of the search text did the trick.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’24
Comment on How to do content transition when one image is a system symbol and the other is in assets catalouge?
Thanks, this is however looks worse than using symbolEffect. Eventually I decided to use two system icons.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24
Comment on isPressed is not reliable when Button is inside ScrollView
Sorry, no. Did not get response to the radar as well.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’25