NSURL
用于表示 URL(网页或本地文件路径)。可通过 Application.sharedInstance().openURL(url) 打开网页或 App URL Scheme。
类成员 (Class members)
Section titled “类成员 (Class members)”| 方法 | 参数 | 返回值 | 说明 |
|---|---|---|---|
URLWithString(URLString) | URLString: string | NSURL | 从字符串创建(如 “https://…”)。 |
URLWithStringRelativeToURL(URLString, baseURL) | URLString, baseURL | NSURL | 相对 URL。 |
fileURLWithPath(path) | path: string | NSURL | 从文件路径创建。 |
fileURLWithPathIsDirectory(path, isDir) | path: string, isDir: boolean | NSURL | 文件 URL,可指定是否目录。 |
实例成员 (Instance members)
Section titled “实例成员 (Instance members)”属性(常用)
Section titled “属性(常用)”| 属性 | 类型 | 说明 |
|---|---|---|
path | string | 路径部分。 |
absoluteString | string | 完整 URL 字符串。 |
host / scheme / query / fragment | string | URL 组成部分。 |