Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa PSFeed-如何设置它“;“空的”;_Cocoa_Publish Subscribe - Fatal编程技术网

Cocoa PSFeed-如何设置它“;“空的”;

Cocoa PSFeed-如何设置它“;“空的”;,cocoa,publish-subscribe,Cocoa,Publish Subscribe,我正在nib中使用绑定到arraycontroller的PSFeed。用户可以在文本字段中输入一个简单的RSS提要,通过按enter键,PSFeed将获得新的提要URL。如果用户未输入任何提要(空文本字段)并按enter键,则执行以下解决方法以强制PSFeed刷新以返回空提要条目列表。这样,我的arraycontroller将更新为空列表 有没有更好的办法 此处是分配虚拟对象的代码段“http://error.ch“对于feedUrl,urlFeed是文本字段 - (IBAction)chang

我正在nib中使用绑定到arraycontroller的PSFeed。用户可以在文本字段中输入一个简单的RSS提要,通过按enter键,PSFeed将获得新的提要URL。如果用户未输入任何提要(空文本字段)并按enter键,则执行以下解决方法以强制PSFeed刷新以返回空提要条目列表。这样,我的arraycontroller将更新为空列表

有没有更好的办法

此处是分配虚拟对象的代码段“http://error.ch“对于feedUrl,urlFeed是文本字段

- (IBAction)changeFeedUrl:(id)sender {
feedURL= SmartURLFromString([urlFeed stringValue],
                            [NSArray arrayWithObjects: @"http",@"https",@"file",@"feed",nil]);
if (feedURL)  // Update with new scheme
    [urlFeed setStringValue:[feedURL absoluteString]];
else {
    feedURL = [NSURL URLWithString:urlErrorFeed];
    [urlFeed setStringValue:@""];
}

NSLog(@"changeFeedUrl %@",feedURL );
[newsFeed initWithURL:feedURL];
feedError = nil;
[self refreshFeed:nil];
}