Resolved How to add url linked buttons to Preference Bundle?

Discussion in 'iOS Programming' started by nightwalker21, Jul 13, 2014.

  1. nightwalker21, Jul 13, 2014
    Last edited: Jul 14, 2014

    nightwalker21 macrumors newbie

    nightwalker21

    Joined:
    Jul 27, 2011
    Location:
    USA
    #1
    Here's what I'm working with and so far only one button is working and I can't figure out why?

    Here's the plist:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>items</key>
    	<array>
    		<dict>
    			<key>cell</key>
    			<string>PSGroupCell</string>
    			<key>defaults</key>
    			<string>net.death.cyfreshinfo</string>
    		</dict>
    		<dict>
    			<key>cell</key>
    			<string>PSGroupCell</string>
    			<key>isStaticText</key>
    			<true/>
    		</dict>
    		<dict>
    			<key>action</key>
    			<string>followOnTwitter</string>
    			<key>cell</key>
    			<string>PSButtonCell</string>
    			<key>icon</key>
    			<string>Twitter.png</string>
    			<key>label</key>
    			<string>Follow us on Twitter</string>
    		</dict>
    		<dict>
    			<key>action</key>
    			<string>likeUsOnFacebook</string>
    			<key>cell</key>
    			<string>PSButtonCell</string>
    			<key>icon</key>
    			<string>Facebook.png</string>
    			<key>label</key>
    			<string>Like us on Facebook</string>
    		</dict>
    		<dict>
    			<key>action</key>
    			<string>support</string>
    			<key>cell</key>
    			<string>PSButtonCell</string>
    			<key>icon</key>
    			<string>Website.png</string>
    			<key>label</key>
    			<string>Needing Support?</string>
    		</dict>
    		<dict>
    			<key>allignment</key>
    			<string>1</string>
    			<key>cell</key>
    			<string>PSGroupCell</string>
    			<key>label</key>
    			<string>Version History:</string>
    		</dict>
    		<dict>
    			<key>allignment</key>
    			<string>2</string>
    			<key>cell</key>
    			<string>PSGroupCell</string>
    			<key>label</key>
    			<string>1.0 - Initial Release</string>
    		</dict>
    		<dict>
    			<key>cell</key>
    			<string>PSGroupCell</string>
    			<key>footerText</key>
    			<string>D3@TH's Creations ©2014</string>
    		</dict>
    	</array>
    	<key>title</key>
    	<string>CyFresh</string>
    </dict>
    </plist>
    
    Here's the actual preference bundle code:

    Code:
    //
    //  CyFreshInfoListController.m
    //  CyFreshInfo
    //
    //  Created by D3@TH <deathsrepo@gmail.com> on 11.07.2014.
    //  Copyright (c) 2014 D3@TH <deathsrepo@gmail.com>. All rights reserved.
    //
    
    #import "CyFreshInfoListController.h"
    
    @implementation CyFreshInfoListController
    
    - (id)specifiers {
    	if (_specifiers == nil) {
    		_specifiers = [[self loadSpecifiersFromPlistName:@"CyFreshInfo" target:self] retain];
    	}
        
    	return _specifiers;
    }
    
    - (void)followOnTwitter {
        if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"tweetbot:"]]) {
            [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"tweetbot:///user_profile/D3ATH2020"]];
        } else if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"tweetings:"]]) {
            [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"tweetings:///user?screen_name=D3ATH2020"]];
        } else if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"twitter:"]]) {
            [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"twitter://user?screen_name=D3ATH2020"]];
        } else {
            [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"http://twitter.com/intent/follow?screen_name=D3ATH2020"]];
        }
    }
    
        -(void)likeUsOnFacebook {
            if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"facebook:"]]) {
                [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"facebook:///pages/D3THs-Creations/136898313050635?ref_type=bookmark"]];
            } else {
                [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://www.facebook.com/pages/D3THs-Creations/136898313050635?ref_type=bookmark"]];
    
        }
    }
        
            -(void)support {
                if ([[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:@"chrome:"]]) {
                    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"chrome:///http://deathscreations.22web.org/"]];
                } else {
                    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"http://deathscreations.22web.org/"]];
    
            }
    }
    
    @end
    
     
  2. nightwalker21 thread starter macrumors newbie

    nightwalker21

    Joined:
    Jul 27, 2011
    Location:
    USA
    #2
    I figured it out I made a simple noob mistake
     

Share This Page