Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
1k views

Summary: In the example application below, a shared_ptr is being captured in an Objective-C block. The Objective-C block is being assigned to an ivar of a dynamically created class using the ...
kennyc's user avatar
  • 5,750
4 votes
1 answer
88 views

Alamofire.request(APPURL.GetAccounts, method: .post, parameters: transactionData, encoding: JSONEncoding.default, headers: nil)....
Samrez Ikram's user avatar
1 vote
1 answer
1k views

I am quite humbled to admit that I have no clue about blocks. I am writing a GUI uninstaller app that uses a privileged helper tool delete all of my product's files and directories. Because the ...
Mike Crawford's user avatar
0 votes
1 answer
1k views

I can't seem to figure out how to call an Objective-C block from Swift! I have the following Objective-C method: - (void)myMethod:(NSDictionary *)selection success:(MyBlock)success; Where MyBlock is:...
Chris Allinson's user avatar
0 votes
0 answers
158 views

I want to retrieve action event of default fullscreen button in AVPlayerViewController. How can i get that button action event? As i want to do edit in that action method. The Fullscreen button will ...
Wasim Makwana's user avatar
0 votes
1 answer
338 views

I'm trying to figure out the weakself/strongself reference for nested blocks What are the difference between: __weak __typeof__(self) weakSelf = self; [self.networkCall_1 completionHandler:^(id ...
ordinaryman09's user avatar
0 votes
2 answers
121 views

I am having the below block in ViewController A dispatch_async(dispatch_get_main_queue(), ^{ [self dismissAnimated:YES completion:^(BOOL finished) { [[NSNotificationCenter defaultCenter] ...
Mohan Ramanathan's user avatar
1 vote
1 answer
56 views

In the MyViewController.h file: @property (nonatomic, copy, nullable, class) void (^saveMetadataSuccess)(MyViewController*const _Nullable myViewController); In the MyViewController.m file: void (^...
mrd's user avatar
  • 4,709
0 votes
1 answer
67 views

I want to fetch the youtube channel list and show it on tableView can anyone help to get the channel list of loggedin user via google.
Shaniraaj's user avatar
1 vote
1 answer
94 views

I'm maintaining an old game code (>5 yrs old) and switched developers hands a few times. Game doesn't has a dedicated player base (an early casino gambling game). RestKit is used for API calls. ...
lal's user avatar
  • 8,250
1 vote
1 answer
228 views

I have a (actually a few) quite long api call with a callback block like this: [[APIsController sharedInstance] submitCaptchaRequestWithParams:param ...
Eddie's user avatar
  • 1,951
0 votes
2 answers
45 views

A friend of mine helped me work through a computation problem where I am trying to create a series based on some conditions. He used JS with recursion. I sat down to translate this into Obj-C and am ...
ToddB's user avatar
  • 2,520
0 votes
2 answers
849 views

Upon receiving an NSString, I would like to call a specific code block. I figured an NSDictionary would be best for associating these. Simplified, I'm using something like: MyProtocol.h: @protocol ...
ardnew's user avatar
  • 2,138
0 votes
3 answers
2k views

I have a method that contains an block which defined in Objective - C: +(void)getNewList:(NewListRequestModel *)model returnInfo:(void(^)(NewListResponseModel* resModel))retModel; and I invoke it ...
Neko's user avatar
  • 589
3 votes
1 answer
722 views

I'd like to understand why this crashes with an EXC_BAD_ACCESS error. It returns from the method call fine, but then crashes immediately afterwards on the [self runMethodThatAssignsError:&error] . ...
Alex's user avatar
  • 3,981
2 votes
2 answers
169 views

When bringing externally declared variables into a block... Using the __block directive captures a variable by reference... Variables local to the enclosing lexical scope declared with the __block ...
Gukki5's user avatar
  • 517
0 votes
1 answer
135 views

I’ve not had much experience with semaphores, nor with blocks. I’ve seen various suggestions for how to turn an asynchronous call into a synchronous one. In this case I just want to wait to be sure ...
user938797's user avatar
0 votes
1 answer
78 views

I am unable to figure out why Xcode's static analyzer is giving me the warning "'nil' returned from a method that is expected to return a non-null value". The method is: - (NSURLSessionUploadTask *)...
kanduri vivek's user avatar
0 votes
0 answers
289 views

I were trying to convert a image to NSData and got a below warning. Could you explain to me what is the warning, and how to fix it? CGImageRef cgRef = [imgView.imageView image]; NSBitmapImageRep *...
NextTrang's user avatar
-2 votes
1 answer
1k views

I am very inexperienced with blocks. I have not mastered the syntax. What I would like to do is to pass a date obtained in the first part of a method into a completion block so that the date is not ...
user6631314's user avatar
  • 2,050
5 votes
1 answer
610 views

As we know we need to use a weak reference inside a block to break the retain cycle, like so: __weak id weakSelf = self; [self doSomethingWithABlock:^() { [weakSelf doAnotherThing]; }] However ...
dark_chenshifei's user avatar
0 votes
3 answers
2k views

In my code i have multiple locations,I have to check all the locations are correct or not (checking with google api) if location is correct I have to get the coordinates for that location. I am ...
HariNarasimhaRao.G's user avatar
0 votes
1 answer
76 views

I have a list of PHAsset that I need to get their associated URL and do something with each URL. After all the assets are processed I need to perform another task. I try to use __block to count the ...
Thinium's user avatar
  • 313
-1 votes
2 answers
2k views

I am learning objective c and swift. i didn't get what is difference between block and method or function in Objective c or in Swift. int mutiplier=10; int (^myBlock)(void)=^{ return 10 *3; }; ...
Mujahed Ansari's user avatar
7 votes
3 answers
4k views

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"alert" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *action = [UIAlertAction actionWithTitle:@"action"...
trapper's user avatar
  • 12k

1 2 3
4
5
53