小编mar*_*uca的帖子

64
推荐指数
4
解决办法
3万
查看次数

如何在Ruby中定义没有'class'语句的类?

我有很多类要定义,但我不想重复以下工作:

class A < ActiveRecord::Base
end
Run Code Online (Sandbox Code Playgroud)

是否有任何声明语句来定义类而不使用该class语句?

ruby class

4
推荐指数
2
解决办法
267
查看次数

如何使用NSURLDownload

- (IBAction)startDownloadingURL:(id)sender
{
    // create the request
    NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com/index.html"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];

    // create the connection with the request
    // and start loading the data
    NSURLDownload  *theDownload=[[NSURLDownload alloc] initWithRequest:theRequest delegate:self];

    if (!theDownload) {
        // inform the user that the download could not be made
    }
}
Run Code Online (Sandbox Code Playgroud)

当我运行模拟器时,我收到一个错误:

NSURLDownload unclared,首次使用此功能.

我在哪里可以导入NSURLDownload库.

iphone cocoa-touch objective-c nsurlconnection

3
推荐指数
1
解决办法
6226
查看次数

标签 统计

ruby ×2

class ×1

cocoa-touch ×1

iphone ×1

nsurlconnection ×1

objective-c ×1