第4月第2天 nsinvocation崩溃 mvc videotrack

时间:2022-07-17 07:56:28

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:];
}
[videoTrack addMediaObject:mediaObj];
}
[timeline addTrack:videoTrack];//
[timeline addTrack:musicTrack];//
[timeline addTrack:audioTrack];//
[timeline addTrack:overlayTrack];//