Mile Mile - 4 months ago 6
iOS Question

Re: How Do I Make A Count For The Amount Of Times A Certain URL Was Open From A Different Web View?

I changed up the question because the last question wasn't clear enough.

I want to implement this for the amount of times a certain URL was open. I need the count for when a certain URL is opened from another URL that I set in a UIWebView. Thanks in advance.

Here is my code:

.h:
int Number;

.m:
Number += 10;
Label.text = [NSString stringWithFormat:@"%d”, Number];

Answer

Do something like the following:

- (void)openURL:(UIButton *)sender
{
    NSString *url = //URL;
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
    Number += 1;
    Label.text = [NSString stringWithFormat:@"%d", Number];
}
Comments