Jump to content

How to add multiple links to a preference bundle?


KingRalph

14 posts in this topic

Recommended Posts

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.

Link to comment
Share on other sites

 

- (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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • 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