大约有 17 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0042 秒)
...ue ? NO : YES]; } +(void)testAsyncCallback:(NSString*)json { //js thread NSError* error = nil; NSData* jsonData = [json dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error]; NSLog(@"OC:...
来源: Laya3.0_文档 发布时间: 20250422
...LayaNative底层LOG分为五种: enum class LogType { Debug, Info, Warn, Error, Fatal, }; 每种日志对应的日志级别如下: enum class LogLevel { Debug = 5, Info = 4, Warn = 3, Error = 2, Fatal = 1, Close = 0, }; 在js脚本中,开发者可以通过以下函数设置日志级别,默认...
来源: Laya3.0_文档 发布时间: 20251010
...一<code>Position</code>参数的回调处理器。 * @param onError 可选的。带有错误信息的回调处理器。错误代码为Geolocation.PERMISSION_DENIED、Geolocation.POSITION_UNAVAILABLE和Geolocation.TIMEOUT之一。 */ static getCurrentPosition(onSuccess: Handler, onError:...
来源: Laya3.0_文档 发布时间: 20251010
...发送的数据时触发。 Event.CLOSE:连接关闭时触发。 Event.ERROR:连接出错时触发。 示例代码: // 注册事件监听示例 this.socket.on(Laya.Event.OPEN, this, this.onSocketOpen); this.socket.on(Laya.Event.MESSAGE, this, this.onMessageReceived); this.socket.on(Laya.Event....
来源: Laya3.0_文档 发布时间: 20251010
...404 Not Found” 表示请求的资源不存在;“500 Internal Server Error” 表示服务器内部出现错误。 响应头部包含了关于响应的各种信息,如内容类型(Content - Type)、内容长度(Content - Length)、服务器软件(Server)等。例如,“Content - ...
来源: Laya3.0_文档 发布时间: 20251010
... "laya.events.Event")]*/ /** * 请求出错时调度。 * @eventType Event.ERROR * */ /*[Event(name = "error", type = "laya.events.Event")]*/ 2.1.4 在代码中怎么使用 LayaAir引擎中用 HttpRequest 继承的是 EventDispatcher,具有事件派发的功能。加上本身具备发送请求的...
来源: Laya3.0_文档 发布时间: 20250104
... { console.log("WebSocket closed"); }; // 连接错误处理 this.socket.onerror = (error) => { console.error("WebSocket error:", error); }; } private handleServerResponse(buffer: Uint8Array) { // 尝试解码为 ChatMessage,使用 decode 方法,将接收到的 Uint8Array 数据 buffer 反序...
来源: Laya3.0_文档 发布时间: 20251010
...s,Laya.Handler.create(this,this.onSuccess),Laya.Handler.create(this,this.onError)); } } private showMessage():void{ var tex:Laya.Text = new Laya.Text(); Laya.stage.addChild(tex); tex.text = "单击舞台播放和暂停"; tex.color = "#ffffff"; tex.fontSize = 100; tex.valign = "middle"; tex.align = "...
来源: Laya3.0_文档 发布时间: 20251010
...andler.create(this, this.updatePosition), Laya.Handler.create(this, this.onError)); // 绑定convertToBaiduCoord作用域 this.convertToBaiduCoord = this.convertToBaiduCoord.bind(this); } } 由于本例不需要使用LayaAir的显示元素,因此舞台尺寸设置为1。百度地图界面的初始...
来源: Laya3.0_文档 发布时间: 20251010
...图1-11) 1.3.3 弹窗显示全局错误 如果捕获全局错误window.onerror,勾选弹窗显示全局错误可以弹窗抛出详细错误堆栈。例如,可以自定义一个全局错误,代码如下: //自定义一个全局错误 let err = new Error("自定义的Error"); Laya.Browser.wi...
来源: Laya3.0_文档 发布时间: 20251014