我收到了这个错误
"Nil与返回类型'MKOverlayRenderer'不兼容".
这是我的代码:
func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer {
if overlay is MKCircle {
let circleRenderer = MKCircleRenderer(overlay: overlay)
circleRenderer.lineWidth = 1.0
circleRenderer.strokeColor = UIColor.purpleColor()
circleRenderer.fillColor = UIColor.purpleColor().colorWithAlphaComponent(0.4)
return circleRenderer
}
return nil
}
Run Code Online (Sandbox Code Playgroud)
它为什么会发生?
我正在尝试使用 AVExportSession 修剪和下载在线视频。
代码:
FileMove *fileMove = (FileMove*)data;
NSString *url = @"http://download.wavetlan.com/SVV/Media/HTTP/H264/Talkinghead_Media/H264_test1_Talkinghead_mp4_480x360.mp4";
NSURL *videoURL = [NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSLog(@"VideoURL: %@",videoURL);
AVAsset *anAsset = [AVURLAsset URLAssetWithURL:videoURL options:nil];
NSArray *compatiblePresets = [AVAssetExportSession exportPresetsCompatibleWithAsset:anAsset];
if ([compatiblePresets containsObject:AVAssetExportPresetLowQuality]) {
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc]
initWithAsset:anAsset presetName:AVAssetExportPresetLowQuality];
NSURL *outputURL = [NSURL fileURLWithPath:fileMove.dst];
NSLog(@"outputURL: %@",outputURL);
exportSession.outputURL = outputURL;
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
CMTime start = CMTimeMakeWithSeconds(1.0, 600);
CMTime duration = CMTimeMakeWithSeconds(3.0, 600);
CMTimeRange range = CMTimeRangeMake(start, duration);
exportSession.timeRange = range;
if ([[NSFileManager defaultManager] fileExistsAtPath:fileMove.dst])
[[NSFileManager defaultManager] removeItemAtPath:fileMove.dst …Run Code Online (Sandbox Code Playgroud) 为了不使用UICollectionViews创建类似于表格的电子表格,我决定使用嵌套的UIStackViews。
但是,由于我在UITableViewCell中使用它们并以编程方式创建它们,因此必须将其从单元格中删除,否则,当它重新绘制该单元格时,新视图将与旧视图重叠。
但是,从父视图中删除它们时,它会崩溃。如何正确删除嵌套的UIStackViews?
我的代码来创建嵌套的UIStackViews:
let table = UIStackView()
table.axis = .Vertical
table.spacing = 8
let json = JSON(data: jsonNew)
for i in 0..<json["Rows"].count{
let horizontal = UIStackView()
horizontal.axis = .Horizontal
horizontal.spacing = 8
for j in 0..<json["Rows"][i]["Column"].count{
let label = UILabel()
label.text = json["Rows"][i]["Column"][j].string!
label.lineBreakMode = .ByWordWrapping
label.numberOfLines = 0
label.font = label.font.fontWithSize(12)
horizontal.addArrangedSubview(label)
}
table.addArrangedSubview(horizontal)
}
Run Code Online (Sandbox Code Playgroud)
这就是我从单元格中删除所有视图的方式:
for myview in view.subviews{
myview.removeFromSuperview()
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
2016-05-17 11:37:58.745 TestProject [678:26088] _UIConstraintBasedLayoutLog Unsatisfiable关闭2016-05-17 11:38:16.563 TestProject [678:26088] UISV-fill-proportionally.negError {id:13542} + <995:1,250:5.6875> * 0x12fd1b3f0:UISV-fill-proportionally.posErrorMarker …
我正在与Facebook AppInvites合作.
我需要将我的应用程序的直接消息/邀请发送给我的Facebook好友.
我正在尝试这段代码 -
this.facebook.appInvite(
{
url: "myapp://invite_from_fb?referral=123456789",
picture: ""
}
);
Run Code Online (Sandbox Code Playgroud)
错误 -
错误错误:未捕获(在承诺中):无法显示对话框
我有一个带有表视图的视图控制器.每个单元格都有一个带五星评级系统的自定义视图.我在视图的类中处理视图的touchesBegan
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView:self];
[self handleTouchAtLocation:touchLocation];
}
Run Code Online (Sandbox Code Playgroud)
如何获取indexPath以了解哪个单元用户投票?我没有按钮我有uiview所以我不能使用以下内容:
CGPoint buttonPosition = [sender convertPoint:CGPointZero toView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:buttonPosition];
Run Code Online (Sandbox Code Playgroud) 我一直在尝试拉一个docker镜像:container-registry.oracle.com/database/enterprise:12.2.0.1
但我收到以下错误::
来自守护程序的错误响应:container-registry.oracle.com/database/enterprise的拉式访问被拒绝,存储库不存在或可能需要“ docker登录”
我什至尝试登录到oracle存储库。但是结果没有什么不同。
root@Linux-Vostro-3250:~# docker pull container-registry.oracle.com/database/enterprise:12.2.0.1
Error response from daemon: pull access denied for container-registry.oracle.com/database/enterprise, repository does not exist or may require 'docker login'
root@Linux-Vostro-3250:~#
root@Linux-Vostro-3250:~# docker login container-registry.oracle.com
Username (amal.v@ctebs.com): amal.v@ctebs.com
Password:
Login Succeeded
root@Linux-Vostro-3250:~# docker pull container-registry.oracle.com/database/enterprise:12.2.0.1
Error response from daemon: pull access denied for container-registry.oracle.com/database/enterprise, repository does not exist or may require 'docker login'
root@Linux-Vostro-3250:~#
Run Code Online (Sandbox Code Playgroud)
我还尝试通过登录从docker存储中提取相同的图像。
希望得到解释。。谢谢您的时间!
我有一个类似的阵列
"11 Aug 2015",
"24 Sep 2014",
"25 Aug 2014",
"07 Aug 2014",
"07 Aug 2014"
Run Code Online (Sandbox Code Playgroud)
我想在其中找到最大和最小日期.
modifieddateArray.valueForKeyPath("@max.self")
modifieddateArray.valueForKeyPath("@min.self")
Run Code Online (Sandbox Code Playgroud)
我使用了上面给出的功能
最高为2014年8月25日
分钟为2014年8月7日
但最长日期为2015年8月11日,最低日期为2014年9月7日
它考虑的第一个值大于25,最小值为07.我怎么能解决.
提前致谢
我正在使用RODBC包访问我在R中的sql数据库.我无法找到有关如何将矢量从R传递到sql作为向量的任何有用信息.
id <- ('00003', '00100')
query <- sqlQuery(channel = channel, query = "select *
from prod_cust_vw.store_dim
where store_num in id")
Run Code Online (Sandbox Code Playgroud)
我想将id向量传递给sql而不是硬编码.