Jump to content

How to add multiple links to a preference bundle?


Go to solution Solved by Rook,

14 posts in this topic

Recommended Posts

Posted

It doesn't work. All the buttons open the same link :(

- (void)link {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

- (void)link2 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

- (void)link3 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

- (void)link4 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

Then add the buttons inside the Preferences.plist and make sure each is different. link,link2,link3,link4 etc.

Posted

 

- (void)link {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

- (void)link2 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

- (void)link3 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end

- (void)link4 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
} 
@end
 
Then add the buttons inside the Preferences.plist and make sure each is different. link,link2,link3,link4 etc.
I see...

You have to add the @end.

  • Solution
Posted

I see...

You have to add the @end.

It's cleaner like this:

- (void)link {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
}
- (void)link2 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
}
- (void)link3 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
}
- (void)link4 {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.iosgods.com"]];
}
@end

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines