2,623 questions
0
votes
0
answers
81
views
How to correctly call an iOS completionHandler block from Delphi without crashing?
I’m trying to implement this iOS delegate method in Delphi:
- (void)URLSession:(NSURLSession *)session
task:(NSURLSessionTask *)task willBeginDelayedRequest:(NSURLRequest *)request ...
0
votes
0
answers
46
views
Why is my Swift function not printing from inside the dataTask closure? [duplicate]
I am trying to learn about making http requests using Swift but for some reason i cannot get the getPosts() method to print anything. It keeps skipping over the dataTask and prints after it. I ...
1
vote
2
answers
267
views
convert gcc forward-declared nested function to clang blocks
I know this is impossible because I've spent hours on it and also read these below but I am determined to approximate a clang block forward definition even if it takes linker tricks or inline assembly:...
0
votes
1
answer
74
views
Purpose of code blocks in this Objective-C method
I'm newish to objective C and and have a question about code from this example project from Apple showcasing some Metal features.
The code contains a few blocks sitting inside of the function scope. ...
0
votes
1
answer
34
views
how to check if scrollView grinds to a halt when tabbar is clicked?
A viewcontroller is the child of tabbarcontroller, it has a tableview, when the tableview grinds to a halt, one of three methods is executed.
- (void)scrollViewDidEndDragging:(UIScrollView *)...
0
votes
1
answer
63
views
Block mutates a variable that is indirectly in it's scope
This is the most minimal example I could think of:
#import <Foundation/Foundation.h>
@interface ObjCClass:NSObject
@property void (^aBlockInner) ();
-(void)method;
-initWithBlock:(void (^)())...
1
vote
1
answer
125
views
How to share a block between MRC and ARC code?
I have a piece of ARC code written in Objective-C that is creating a block and will want to provide it to some Objective-C MRC code as a callback, to be called when an operation finishes. What is the ...
1
vote
0
answers
144
views
Qt iOS app crash in completion handler callback with EXC_BAD_ACCESS
I'm writing a Qt app on iOS which uses the MLKit FaceDetector. I have a FaceDetector class which has the following method:
void FaceDetector::runFaceDetection(const QImage &image)
{
// ...
3
votes
0
answers
3k
views
What is iOS's block_destroy_helper function?
I noticed a function named block_destroy_helper in this crash log from my iOS app. I want to know more what is this function, but I can't find any useful information. I just want to know the ...
2
votes
0
answers
44
views
Is the number before selector name in crash log meaningful to developer?
Sometimes, we can see some log trace with line number as 0 as the following:
Thread 21 Crashed:
0 libobjc.A.dylib 0x00000001a04cf28c objc_release + 16
1 MyApp ...
4
votes
1
answer
1k
views
Calling block from Objective C collection in Swift
I have a Swift object that takes a dictionary of blocks (keyed by Strings), stores it and runs block under given key later at some point depending on external circumstances (think different behaviours ...
0
votes
0
answers
663
views
Crash with [NSOperationBlock dealloc]
There is a crash in the application I am working on. The following is the crash log:
Exception Type: SIGSEGV
Exception Codes: SEGV_MAPERR at 0xf86985380
Crashed Thread: 4
Thread 4 Crashed:
0 ...
0
votes
1
answer
833
views
Pass Objective-C block or method as C-function pointer
I'm using https://github.com/nodejs/http-parser, the callbacks it uses are like this
struct http_parser_settings {
http_cb on_message_begin;
http_data_cb on_url;
http_data_cb on_status;
...
4
votes
1
answer
74
views
Objective-C: Why two requests of [object copy] return the same result?
I would expect copy on an object to generate a new object. But it seems it will only generate a different one and may reuse it for another copy.
void (^block1)(void) = ^ {
// ...
};
void (^block2)(...
2
votes
2
answers
152
views
Will weak pointer in a block become dangling when I refer it with stong pointer in OC?
as the question described, will the wSelf in block become dangling?
1 void bindDefaultCallbacks {
2 __weak typeof(self) wSelf = self;
2 [sessionManager setDataTaskDidReceiveDataBlock:^(...