我在Documents文件夹中有一个名为"Video"的子文件夹.还有somevideo.mp4文件.我有这个文件的完整路径,但MPMoviePlayerViewController不想播放本地的视频.这是代码:
NSString *path = [[self getVideoFolderPath] stringByAppendingPathComponent:@"somevideo.mp4"];
NSURL *fURL = [NSURL fileURLWithPath:path];
MPMoviePlayerViewController *videoPlayerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fURL];
[self presentMoviePlayerViewControllerAnimated:videoPlayerView];
[videoPlayerView.moviePlayer play];
Run Code Online (Sandbox Code Playgroud)
它没有播放.出现白色屏幕,没有别的.这个代码适用于远程视频,当我把URL放到带有视频文件的网站,但本地不播放.如何获得正确的视频文件文件路径?
我用ASIHTTPReqeust下载文件.一切都下载得很好,但它无法将文件从临时目录移动到文档.当我实施
-(void) request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data
Run Code Online (Sandbox Code Playgroud)
请求失败并显示错误.但文件已下载.
如果我删除此实现,一切都很好,文件正在转移到文档.这是错误文本:
Error Domain=ASIHTTPRequestErrorDomain Code=8 "Failed to move file from '/var/folders/Qu/Qu0o0VcpEY4npJr2C1yPzE+++TI/-Tmp-/Skrillex feat. Nero - Wobbleland.mp3' to '/Users/Timur/Library/Application Support/iPhone Simulator/4.3/Applications/34389282-4013-4354-95D9-DF2847B4EE55/Documents/Audio/Skrillex feat. Nero - Wobbleland.mp3'" UserInfo=0x5949520 {NSUnderlyingError=0x59992a0 "The operation couldn’t be completed. (Cocoa error 4.)", NSLocalizedDescription=Failed to move file from '/var/folders/Qu/Qu0o0VcpEY4npJr2C1yPzE+++TI/-Tmp-/Skrillex feat. Nero - Wobbleland.mp3' to '/Users/Timur/Library/Application Support/iPhone Simulator/4.3/Applications/34389282-4013-4354-95D9-DF2847B4EE55/Documents/Audio/Skrillex feat. Nero - Wobbleland.mp3'}
Run Code Online (Sandbox Code Playgroud)
谁有类似的问题?
如何设置MPMoviePlayerViewController的通知?它与MPMoviePlayerController中的相同吗?
请显示示例
objective-c mpmovieplayercontroller nsnotificationcenter ios
我正在用SBJson解析json.
我收到错误"-JSONValue failed.错误是:未转义控制字符[0x09]"解析我的json字符串时,它有未编码的选项卡.如何将我的json字符串中的此选项卡替换为\ t?如果我手动删除标签,一切都很好.或者如何正确编码此选项卡?
我将UILabel添加到简单的UITableViewCell,但是当我将设备旋转到横向时,UILabel不会移动到右侧,即使myLabel.autoresizingMask = UIViewAutoResizingFlexibleRightMargin;它位于UITableViewCell的中间.纵向模式myLabel位于UITableViewCell的右侧.这是代码:
myLabel = [[UILabel alloc] initWithFrame:CGRectMake(252, 12, 60, 20)];
myLabel.font = [UIFont fontWithName:@"Helvetica" size:11];
myLabel.textColor = tableViewCell.detailTextLabel.textColor;
myLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
myLabel.highlightedTextColor = [UIColor whiteColor];
myLabel.text = video.duration;
myLabel.tag = 999;
[cell.contentView addSubview:durationLabel];
[myLabel release];
Run Code Online (Sandbox Code Playgroud)
当我将设备旋转到横向模式时,如何将此UILabel移动到单元格的右侧?
我正在使用WIA创建用于图像扫描的应用程序.但是如果扫描的文档尺寸不大,我的图像会有很多未使用的空间.我需要裁剪那些未使用的空间,就像使用交叉光标和矩形的Paint一样.如何在WPF中做到这一点?图像裁剪代码是:
private static Image cropImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea,bmpImage.PixelFormat);
return (Image)(bmpCrop);
}
Run Code Online (Sandbox Code Playgroud) 我想创建与facebook app for iOS相同的登录名和密码字段.这是截图:

我创建了UserControl,我不知道在使用它时如何设置Name属性.
<my:LabelListBox Margin="12,314,480,12"/>
Run Code Online (Sandbox Code Playgroud)
我需要从我的代码中访问此控件.但没有名字,我不知道如何.
我需要从WPF Window类中获取字符串值?例如,我有一个MainWorkspace窗口类的实例,我想得到这个"MainWorkspace"字符串.这该怎么做?
我的iPhone 4与iOS 4.3.2没有越狱.
我想将iOS升级到5.x版本.如果我这样做,我可以为iOS 4.3编写应用程序吗?我的意思是他们在iOS 5.x上的工作方式与iOS 4.3相同吗?iOS 4.x API和5.x之间有哪些主要区别?