hw-1

Error: The method 'inheritFromWidgetOfExactType' isn‘t defined for the class 'BuildContext'.

Error: The method ‘inheritFromWidgetOfExactType’ isn‘t defined for the class ‘BuildContext’.

Example of a replacement:

Before : with InheritFromWidgetOfExactType

1
2
3
static Name of(BuildContext context) {
return context.inheritFromWidgetOfExactType(Name); //before
}

Now with dependOnInheritedWidgetOfExactType (Recommanded)

1
2
3
static Name of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<Name>(); //after
}

This can happen if layout contains custom windows and there are compile errors in the project. 问题

This can happen if layout contains custom windows and there are compile errors in the project. 问题

1
2
3
1. In the projects Library folder there is a file "CurrentLayout-default.dwlt"
2. Go into USER/Library/Preferences/Unity/Editor-5.x/Layouts/Default and open the file "Default.dwlt" in a text editor, copy all the content of it and replace the content of the "CurrentLayout-default.dwlt" with it.
3. Open your project

ios上libevent在dns解析时崩溃的解决

ios上libevent在dns解析时崩溃的解决

libevent版本:2.0.11-stable 在DNS解析时需要使用ARC4RANDOM算法生成transaction id,而ios自带的算法库有问题,会导致崩溃。还好,libevents提供了另一套替代的算法库,使用该算法库可以不崩溃。

1
2
_dns_base = evdns_base_new(_base, 0);
evdns_base_nameserver_ip_add(_dns_base, "8.8.8.8");

link

libcurl thread safety

libcurl thread safety

ulti-threading with libcurl

OpenSSL 1.1.0+ “can be safely used in multi-threaded applications provided that support for the underlying OS threading API is built-in.” In that case the engine is used by libcurl in a way that is fully thread-safe.

OpenSSL <= 1.0.2 the user must set callbacks.

link[https://curl.se/libcurl/c/threadsafe.html]