第4月第2天 nsinvocation崩溃 mvc videotrack

1.

        __unsafe_unretained id result = nil;
        [invocation getReturnValue:&result];
        return result;

 

 

http://www.jianshu.com/p/ab6131ac7e70

http://www.cocoachina.com/bbs/read.php?tid=197684

2.

一个uiviewcontroller包含一个uitableview,那么viewcontroller必须要实现uitableview的datasource。如果uitableviewcell有多个,并且每一种类型最好分离出来。那么uiviewcontroller可以使用nsdictionary包含多个logic类,通过类型找到logic类,在logic类实现cellForRowAtIndexPath逻辑。

这样一个uiviewcontroller有多个logic类处理uitableview的细节。

一个uiviewcontroller需要调用多个接口获取网络数据,就有多个 发送请求,解析数据 。发送请求,解析数据可以放在一个类里,放在单例里也可以,只是会导致这个单例膨胀。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

3.

    videoTrack = [[qxTrack alloc] initWithTrackType:eMT_Video];
    
    for (BaseView *baseView in  toolBar.itemArray) {
        ALAsset *asset = baseView.item.asset;
        qxMediaObject *mediaObj = [[qxMediaObject alloc] init];
        int type = eMT_Video;
        if([asset valueForProperty:ALAssetPropertyType] == ALAssetTypePhoto){
            type = eMT_Photo;
        }
        
        NSURL *url = [asset valueForProperty:ALAssetPropertyAssetURL];
        [mediaObj setFilePath:[url absoluteString] withType:type fromAssetLibrary:YES];
        
        if(type == eMT_Photo){
            [mediaObj setDuration:3000];
        }
        [videoTrack addMediaObject:mediaObj];
    }
    [timeline addTrack:videoTrack];//0
    [timeline addTrack:musicTrack];//1
    [timeline addTrack:audioTrack];//2
    [timeline addTrack:overlayTrack];//3
原文地址:https://www.cnblogs.com/javastart/p/6242048.html