unsafemutablepointer Questions
2
What do I do about this? I get no useful info predictably. A search for
UnsafeMutablePointer yields
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targ...
Stoichiometric asked 28/4, 2022 at 10:25
2
Solved
I got some unexpected behavior using UnsafeMutablePointer on an observed property in a struct I created (on Xcode 10.1, Swift 4.2). See the following playground code:
struct NormalThing {
var anI...
Gradygrae asked 22/12, 2018 at 0:37
2
Solved
I am working with Accelerate library for my iOS app. I built this app in Swift 2.0 a couple years ago and it was working fine. Now that Swift is updated to 3.0 and 4.0, I have to convert most of th...
Backman asked 2/5, 2018 at 11:0
1
Solved
I'm using a C library in my Swift project, and one of functions requires a UnsafePointer<UnsafePointer<UInt8>?>! as an in-out argument where I should pass my data. But the problem is th...
Seraph asked 21/2, 2018 at 20:45
1
Given an instance of UnsafeMutablePointer, what's the point of calling deinitialize(count:) right before deallocate(capacity:)?
Can't you just call deallocate(capacity:)?
I saw this when readin...
Heredia asked 18/10, 2017 at 16:0
1
Objective-c has a concept of a pointer to a pointer. If you dereference the first pointer you can access the original
void makeFive(int *n) {
*n = 5;
}
int n = 0;
makeFive(&n);
// n is now 5...
Shaynashayne asked 20/9, 2017 at 18:44
2
Solved
I have a block that is passing data in that I'd like to convert to an array of array of floats -- e.g. [[0.1,0.2,0.3, 1.0], [0.3, 0.4, 0.5, 1.0], [0.5, 0.6, 0.7, 1.0]]. This data is passed to me in...
Umbilical asked 10/6, 2017 at 18:40
1
Solved
I'm trying to understand the use of pointers in Swift, in particular: Unsafe[Mutable]Pointer and UnsafeRaw[Mutable]Pointer. I have several questions on the subject.
Is UnsafePointer <T> equ...
Overmatter asked 22/2, 2017 at 14:27
2
Solved
I have a little Problem with my Code after updating to Swift 3. I had this Code before the conversion:
extension NSData {
func castToCPointer<T>() -> T {
let mem = UnsafeMutablePointer&...
Kersey asked 2/11, 2016 at 10:29
1
Here was my workable code in the previous version of Swift:
let imageOptionsDictKeys = [ kCVPixelBufferPixelFormatTypeKey, kCVPixelBufferWidthKey, kCVPixelBufferHeightKey, kCVPixelBufferOpenGLESC...
Suppliant asked 10/10, 2016 at 19:56
1
Within Swift 3, I need to send data to a C object accepting float ** input.
In Swift 2, I used to declare a UnsafeMutablePointer< UnsafeMutablePointer<Float32>>, construct a swift Arr...
Septuagesima asked 19/10, 2016 at 10:7
2
Solved
I'm attempting to call SecItemCopyMatching in my keychain utility class in order to get data out of the keychain, yet I'm running into a problem with getting the result argument, UnsafeMutablePoint...
Bunyabunya asked 12/9, 2016 at 0:18
2
Solved
I am doing some bitwise operations in Swift style, which these codes are originally written in Objective-C/C. I use UnsafeMutablePointer to state the beginning index of memory address and use Unsaf...
Mow asked 16/4, 2016 at 9:22
1
© 2022 - 2024 — McMap. All rights reserved.