WEEX遇到的问题,源码改动备注

1. weex SDK与微信SDK中,WXLogLevel冲突,两者改一个即可:
typedefNS_ENUM(NSUInteger,WXLogLevel){

    WXLogLevelNormal =0,      // 打印日常的日志

    WXLogLevelDetail =1,      // 打印详细的日志

};
2. WXStreamModule类中,由于前端页面传入的url中包含中文,导致请求失败崩溃:
- (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有时候会出现是字典的情况,导致出现[-[__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)

你可能感兴趣的:(WEEX遇到的问题,源码改动备注)