1. weex SDK與微信SDK中,WXLogLevel沖突怠晴,兩者改一個即可:
typedefNS_ENUM(NSUInteger,WXLogLevel){
WXLogLevelNormal =0, // 打印日常的日志
WXLogLevelDetail =1, // 打印詳細(xì)的日志
};
2. WXStreamModule類中,由于前端頁面?zhèn)魅氲膗rl中包含中文遥金,導(dǎo)致請求失敗崩潰:
- (WXResourceRequest*)_buildRequestWithOptions:(NSDictionary*)options callbackRsp:(NSMutableDictionary*)callbackRsp
{
// fml fix
NSString *encodedUrlString = (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)options[@"url"],
(CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]",
NULL,
kCFStringEncodingUTF8));
NSString *urlStr = encodedUrlString;
// parse request url
// NSString *urlStr = [options objectForKey:@"url"];
NSString *newURL = [urlStr copy];
WX_REWRITE_URL(urlStr, WXResourceTypeLink, self.weexInstance)
urlStr = newURL;
if (!options || [WXUtility isBlankString:urlStr]) {
[callbackRsp setObject:@(-1) forKey:@"status"];
[callbackRsp setObject:@NO forKey:@"ok"];
return nil;
}
3. WXComponent+Events類中,暫未找到具體的原因蒜田,- (void)_addEventOnMainThread:(NSString *)addEventName
方法中addEventName
有時候會出現(xiàn)是字典的情況稿械,導(dǎo)致出現(xiàn)[-[__NSDictionaryM isEqualToString:]: unrecognized selector sent to instance
的崩潰情況:
- (void)_addEventOnMainThread:(NSString *)addEventName
{
if (![self isViewLoaded]) {
//This action will be ignored While the view is loaded,
//then it will initEvent according to the records in _events
return;
}
// fml fix
if (![addEventName isKindOfClass:[NSString class]]) {
return;
}
WX_ADD_EVENT(appear, addAppearEvent)
WX_ADD_EVENT(disappear, addDisappearEvent)
WX_ADD_EVENT(click, addClickEvent)
WX_ADD_EVENT(swipe, addSwipeEvent)
WX_ADD_EVENT(longpress, addLongPressEvent)