performselector Questions

11

Solved

I am an iOS newbie. I have a selector method as follows - - (void) fooFirstInput:(NSString*) first secondInput:(NSString*) second { } I am trying to implement something like this - [self per...
Linnette asked 8/12, 2011 at 23:11

17

The performSelector family of methods are not available in Swift. So how can you call a method on an @objc object, where the method to be called is chosen at runtime, and not known at compile time?...
Decor asked 11/6, 2014 at 8:44

8

Solved

I want to change my UILabel's text after 2 seconds. I tried setting my UILabel's text to "A text", and use sleep(2) and finally changing the text to "Another text". But sleep(2) only freezes the ...
Wowser asked 8/8, 2011 at 14:10

3

Everyone knows that ios making support for "performSelector" in swift2.0 I want to know how can get the performSelector return value? let returnValue:Unmanaged<AnyObject> = (self.dataSource?...
Cuprite asked 2/11, 2015 at 11:9

2

I'm attempting to fake the act of clicking a button, by programmatically calling it within my ViewWillAppear() function. The onclick function is defined in my ViewDidLoad(), and you can see I am t...
Avocet asked 13/1, 2016 at 7:22

6

Solved

I want to reload my table data inside a block in this method: import UIKit import AssetsLibrary class AlbumsTableViewController: UITableViewController { var albums:ALAssetsGroup[] = [] func l...
Philosophy asked 9/6, 2014 at 18:12

5

Solved

What will the return value for performSelector: if I pass a selector that returns a primitive type (on object), such as 'week' on NSDateComponents (which will return an int)?
Restaurant asked 27/6, 2011 at 11:18

0

Continuing this question I have this function func getSearch(completed: @escaping DownloadComplete, searchString: String) { let parameters: Parameters = [ "action" : "search"...
Peasecod asked 24/2, 2017 at 18:30

2

Solved

The various performSelector:... methods can handle a maximum of two arguments passed to the specified selector. What can I do if I need to pass three or more arguments?
Phares asked 5/10, 2011 at 12:9

4

The ARC migration tool is refusing to accept this code prior to starting with migration: [self.delegate performSelector:@selector(overlayDismissed:) withObject:self afterDelay:0]; The delegate i...
Penetrating asked 13/1, 2012 at 1:32

3

Solved

I'm trying to get my application to perform an action after a delay, but it will have to be done WHILE the user is interacting with/scrolling on a UIScrollView. I'm not sure why neither performSel...
Congruity asked 28/6, 2012 at 20:52

2

Solved

In ObjC you could simply invoke a class method using the class method from NSObject. [Machine performSelector:@selector(calculate:) withObject:num]; But how do you do this in Swift 2.2? @objc(M...
Riviera asked 24/3, 2016 at 19:7

6

Solved

I am unable to find good documentation about how to subclass NSOperation to be concurrent and also to support cancellation. I read the Apple docs, but I am unable to find an "official" example. He...
Trainor asked 4/10, 2010 at 22:29

3

Solved

Previously, with Objective-C I could use performSelector: in order to repeat an action after a random period of time which could vary between 1-3 seconds. But since I'm not able to use performSelec...
Lupine asked 7/7, 2014 at 12:20

5

Solved

I'm receiving a warning PerformSelector may cause a leak because its selector is unknown In the code: - (void) callDelegate: (SEL) selector withArg: (id) arg error: (NSError*) err { assert(...
Albers asked 7/1, 2012 at 21:21

1

In a current iOS app I am using this perform selector approach: [self performSelector:@selector(doSomething) onThread:myThread withObject:nil waitUntilDone:NO modes:[NSArray arrayWithObject:N...
Siamese asked 2/7, 2014 at 22:4

2

Solved

There's a really strange behavior going on with float / double / CGFloat casting on the result of performSelector: Why does this work? BOOL property = (BOOL)[self.object performSelector:@selecto...
Watteau asked 28/5, 2014 at 3:2

4

Solved

I need a save way to say: "iOS, I want this method to be executed a.s.a.p., but NOT in THIS run loop iteration. At the earliest in the next, but please not in this one. Thank you." Right now I am ...
Promontory asked 17/8, 2011 at 16:22

3

Solved

In the below excerpt, /*A ClassName with instanceMethod and ClassMethod */ -(void)instanceMethod; +(void)ClassMethod; /*To call a instance method in background */ ClassName class1obj = [ClassN...
Cameron asked 28/11, 2012 at 4:37

1

Solved

I have to perform a selector by name on a Class (not an instance) and use its return value: id obj = [objClass performSelector:NSSelectorFromString(methodName) withObject:p1]; The selector creat...

5

Solved

Sorry for the newbie question (maybe). I'm developing an app for ios and i'm trying to execute an external xml reading out of the main thread in order not to freeze the ui while the call is doing i...
Soemba asked 14/5, 2013 at 8:46

1

Solved

I have an imageView added to a view that's presented as a modalViewController, with style horizontal flip. I have added the following code for animating the imageView. - (void)animateTheImageview:...
Susy asked 25/10, 2012 at 9:31

2

Solved

This is an already answer question within SO but I cannot find it in the Apple documentation anywhere. Could you point me in the right direction? Within the following topics Do I have to retain a...
Stephaniestephannie asked 27/6, 2012 at 14:43

1

Solved

I have this strange crash relating to ARC auto-inserting objc_retains in my code. I have the following two classes: @interface MenuItem : NSObject @property (weak, nonatomic) id target; @property...
There asked 9/8, 2012 at 2:20

5

Solved

What is the role of performSelector? Comparing: [self btnClicked]; and [self performSelector:@selector(btnClicked)]; -(void)btnClicked { NSLog(@"Method Called"); } both are woking fin...
Sweat asked 18/7, 2012 at 10:39

© 2022 - 2024 — McMap. All rights reserved.