I am seeing if there is a way to pass a variable to a button in xcode. I have a web link that I am retrieving from an API that I am storing to a NSString. I am just wondering if there is a way to pass that to a button so that when it is clicked it can follow the link accordingly.
Share
You store that URL lcoally in some ivar or property. You assign an action to your button as usual. The action is nothing less than a method of your view controller. Within that method you execute that link.
This is how you can “follow” your link:
In your case you would use an NSString variable instead of the constant that I am using in this example.