我有一个功能,应该在iphone/ipad上将视频重新编码为可管理的比特率.这是:*更新的工作代码,现在有音频!:)*
-(void)resizeVideo:(NSString*)pathy{
NSString *newName = [pathy stringByAppendingString:@".down.mov"];
NSURL *fullPath = [NSURL fileURLWithPath:newName];
NSURL *path = [NSURL fileURLWithPath:pathy];
NSLog(@"Write Started");
NSError *error = nil;
AVAssetWriter *videoWriter = [[AVAssetWriter alloc] initWithURL:fullPath fileType:AVFileTypeQuickTimeMovie error:&error];
NSParameterAssert(videoWriter);
AVAsset *avAsset = [[[AVURLAsset alloc] initWithURL:path options:nil] autorelease];
NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
AVVideoCodecH264, AVVideoCodecKey,
[NSNumber numberWithInt:1280], AVVideoWidthKey,
[NSNumber numberWithInt:720], AVVideoHeightKey,
nil];
AVAssetWriterInput* videoWriterInput = [[AVAssetWriterInput
assetWriterInputWithMediaType:AVMediaTypeVideo
outputSettings:videoSettings] retain];
NSParameterAssert(videoWriterInput);
NSParameterAssert([videoWriter canAddInput:videoWriterInput]);
videoWriterInput.expectsMediaDataInRealTime = YES;
[videoWriter addInput:videoWriterInput];
NSError *aerror = nil;
AVAssetReader *reader = [[AVAssetReader alloc] …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,我希望在每次更改之前保存项目的当前状态,以便撤消和重做将能够在这些状态内来回切换.当我进行更改时,保存位置的代码是:
if(!undoManager){
undoManager = [[NSUndoManager alloc] init];
}
[[undoManager prepareWithInvocationTarget:self] replaceSelf:currentState];
Run Code Online (Sandbox Code Playgroud)
我的撤消/重做功能:
-(void)undo{
if(undoManager){
[undoManager disableUndoRegistration];
[undoManager undo];
[undoManager enableUndoRegistration];
}
}
-(void)redo{
if(undoManager){
[undoManager disableUndoRegistration];
[undoManager redo];
[undoManager enableUndoRegistration];
}
}
Run Code Online (Sandbox Code Playgroud)
替换self函数只接受项目状态属性并分发信息,以便恢复状态.
撤消工作完美,我可以执行5个步骤,然后按5次撤消以倒回到开始,但重做什么都不做!不应该调用重做导致它使用撤消的最后一个对象击中我的选择器?我在这里误解了什么?
我有一个我已经工作了很长一段时间的iPhone应用程序 - Xcode 5.1 IOS 7.
启动VC有一个按钮,触发segue到第二个VC.在VC内部是一个容器视图,它有一个嵌入到导航控制器的segue.
突然间,在没有改变故事板或细分的任何事情的情况下,当我试图转向第二个VC时,我遇到了崩溃.错误是:
*断言失败 - [UIStoryboardEmbedSegue perform],/ SourceCache/UIKit_Sim/UIKit-2935.137/UIStoryboardEmbedSegue.m:18 2014-04-11 10:10:58.371 5 Star Health [42501:60b]*由于未捕获的异常而终止应用程序' NSInternalInconsistencyException',原因:'containerView是必需的.'
我已经尝试重做第二个VC上的所有内容而没有运气.我也研究过这个错误,但没有发现任何适用的错误.
我在FancyApps页面上看到了这个例子:http://jsfiddle.net/STgGM/,但是我需要做类似的事情,但是使用iframe!当我用URL替换图像路径时,它不会做任何事情,没有错误或任何东西.
$.fancybox.open([
{
href : 'http://fancyapps.com/fancybox/demo/1_b.jpg',
title : '1st title'
},
{
href : 'http://fancyapps.com/fancybox/demo/2_b.jpg',
title : '2nd title'
}
], {
padding : 0
});
Run Code Online (Sandbox Code Playgroud)
如何修改此代码以在iframe中显示我的网址.
我也尝试过这种变化:
$.fancybox({
href: url,
openEffect: 'none',
closeEffect: 'none',
width: 960,
height: 540
});
Run Code Online (Sandbox Code Playgroud)
谢谢你,杰森
我是DNN网站的新手,并希望在我的皮肤顶部显示根级页面列表(主页,联系我们等).现在我有:
TabController.GetPortalTabs(0,-1, false, "", false, false, false, true,false);
Run Code Online (Sandbox Code Playgroud)
喂我的转发器,显示链接.但是,当我登录以编辑页面时,导航会增长到包括所有管理级别页面并破坏我的设计.即使我已登录,有没有办法让公共页面显示?
我有一个uiscrollview,它有一个包含文本和图像的自定义子视图.文本项目是UILabels.我附上了代表质量问题的图片:

你们是否认为绘制文本可能值得一试,然后转换为uiimage并显示相反?也许它会更好地扩展?或者也许有一种方法来平滑文本?
我有一个xelement是基本的html,我想快速遍历所有的段落标签元素并设置样式属性或追加到它.我正在做下面的事情,但它没有改变主要的元素.我怎样才能做到这一点?
XElement ele = XElement.Parse(body);
foreach (XElement pot in ele.DescendantsAndSelf("p"))
{
if (pot.Attribute("style") != null)
{
pot.SetAttributeValue("style", pot.Attribute("style").Value + " margin: 0px;");
}
else
{
pot.SetAttributeValue("style", "margin: 0px;");
}
}
Run Code Online (Sandbox Code Playgroud) 我有n个整数,我需要一个快速的逻辑测试,看看它们都是不同的,我不想比较每个组合找到一个匹配...任何关于一个漂亮和优雅的方法的想法?
我不在乎你的想法是什么编程语言,我可以转换!
iphone ×3
objective-c ×3
c# ×2
ios ×2
ipad ×2
asp.net ×1
crash ×1
dotnetnuke ×1
fancybox-2 ×1
iframe ×1
jquery ×1
logic ×1
math ×1
numbers ×1
segue ×1
storyboard ×1
uilabel ×1
xelement ×1