0

_urlS外部にアクセスしようとしていますinitWithURL:。その中に NSLog を入れると値が得られますがNSLogwebsiteload:に入れると が得られ(null)ます。

本当に奇妙です、誰かアイデアはありますか?

.h ファイル:

@interface WebsiteViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate, MFMailComposeViewControllerDelegate, UIWebViewDelegate, UITextFieldDelegate> {
    UIPopoverController *popoverController;
    UIBarButtonItem *barButton;

    NSString *urlWeb;

    IBOutlet UIWebView *Website;

    UILabel *testLabel;

    IBOutlet UIButton *btn;

    IBOutlet UILabel *lbllong;

    IBOutlet UIActivityIndicatorView *activityIndicator;
}

@property (nonatomic, retain) IBOutlet UIPopoverController *popoverController;
@property (nonatomic, retain) IBOutlet UIBarButtonItem *barButton;
@property (nonatomic, retain) NSString *urlS;

- (void)addBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc;
- (void)removeBarButtonItem;

- (id)initWithURL:(NSString *)postURL;


@end

.m ファイル:

#import "WebsiteViewController.h"

@interface WebsiteViewController ()

@end

@implementation WebsiteViewController

@synthesize barButton, popoverController;
@synthesize urlS = _urlS;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (id)initWithURL:(NSString *)postURL
{
    self = [super init];
    if (self) {
        _urlS = [[postURL stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] retain];
        [lbllong setText:_urlS];
    }
    return self;
}

-(IBAction)websiteload:(id)sender {

    NSLog(@"%@", _urlS);


}

- (void)addBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc {

}
- (void)removeBarButtonItem {

}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
4

1 に答える 1