在尝试提交我的应用时,iTunes Connect说
缺少营销图标.iOS应用程序必须包含PNG格式的1024x1024px营销图标.不包含营销图标的应用无法提交给App Review或Beta App Review.
我在iTunes Connect中的提交中有一个1024x1024px的PNG,在General App Information和App Icon.所以我猜他们希望我在Xcode中将它作为资产添加到捆绑包中.但是当我将PNG拖放到此Unassigned占位符时,没有任何反应.
此错误在WWDC 2017之后开始出现,我安装了XCode 9 Beta.此问题也出现在版本8.3.1(8E1000a)中.
例如ListView,我不能让我的元素正确调整大小.
我有一个ListActivity搜索,一个仪表板,一个编辑框和一个列表视图.想法是在键盘显示时隐藏操作栏.
我扩展了LinearLayout,听取视图大小的变化(这里推荐):
public class SizeChangingLinearLayout extends LinearLayout {
//...
@Override
protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld)
{
View actionbar = mainView.findViewById(R.id.actionbar);
if (yNew > yOld)
actionbar.setVisibility(View.VISIBLE);
else if (yNew < yOld)
actionbar.setVisibility(View.GONE);
super.onSizeChanged(xNew, yNew, xOld, yOld);
}
}
Run Code Online (Sandbox Code Playgroud)
操作栏的隐藏/显示按预期工作,但ListView在隐藏操作栏的高度下方有一个间隙.一旦任何图形改变(例如在编辑框中书写),ListView填补空白.隐藏键盘时,反向出现类似的行为.

[编辑]
更改其他布局时也会出现同样的问题.直接更改节目中的内容,但Visibility在onSizeChanged其他一些用户操作重新绘制这些视图之前,不会显示更改大小和边距.无效无效onSizeChanged.
[/编辑]
我试图通过以下方式刷新图形:
invalidate-ing无论是定制的LinearLayout和ListView (推荐这里)notifyDataSetChanged 在列表的适配器上forceLayout......还有更多,没有成功.为什么一开始ListView不调整大小?我是否必须onLayout在扩展的LinearLayout中覆盖?我错过了什么?
我有一个TextView应该按下按钮时显示,并让用户通过键盘输入文本.
- (IBAction) changeName {
changeNameBtn.hidden = YES;
backBtn.hidden = YES;
usernameLabel.hidden = NO;
inputTextField.hidden = NO;
[inputTextField becomeFirstResponder]; // to show keyboard
}
Run Code Online (Sandbox Code Playgroud)
这适用于我们大多数人.
但键盘没有显示我的一些测试人员,位于地理位置偏远的位置.怎么麻烦拍这个?这可能是我们设备行为不同的原因?它对我和其他人都很好.我们都使用相同的设备(iPod,iOS 4.1 - 5.1).
我试过的第一件事不起作用:
我猜测inputTextField在某种程度上没有及时显现,在becomeFirstResponder被解雇之前,所以我添加了setNeedsDisplay因为我认为会强制更新.
[inputTextField setNeedsDisplay];
[inputTextField becomeFirstResponder];
Run Code Online (Sandbox Code Playgroud)
我试过的第二件事不起作用:
if([inputTextField canBecomeFirstResponder]){
[inputTextField becomeFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
我尝试的第三件事是解决方法,要求不幸的用户按下该字段:
- (IBAction) inputTextFieldTouch {
[inputTextField becomeFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
这种解决方法有效,但必须有更好的方法.请告诉我我做错了什么!:)以及如何处理这样的问题而不能自己复制?
我创建了一个从设备名称中提取用户名的函数.
我们的想法是跳过设置步骤,以允许用户在第一次启动应用程序时直接进行游戏.
这是次优的方法,因为我永远不会相信设备名称来保存用户的名称.问题是:有什么更好的方法可以做到这一点?
我的下面的功能得到了正确的名字......
如果用户已将设备名称更改为默认表单以外的其他名称,则显然无法使名称正确.
- (NSString *) extractPlayerNameFromDeviceName: (NSString *) deviceName {
// get words in device name
NSArray *words = [deviceName componentsSeparatedByString:@" "];
NSMutableArray *substrings = [[NSMutableArray alloc] init];
for (NSString *word in words) {
NSArray *subwords = [word componentsSeparatedByString:@"'"];
[substrings addObjectsFromArray:subwords];
}
// find the name part of the device name
NSString *playerName = [NSString stringWithString: @""];
for (NSString *word …Run Code Online (Sandbox Code Playgroud) 我们最近开始使用Behave(github链接)用于新的python Web服务的BDD.
有什么方法可以在测试失败时获得有关失败原因的详细信息吗?他们扔了AssertionError,但他们从来没有表明究竟出了什么问题.例如,期望值和进入断言的实际值.
我们一直试图找到这样的现有功能,但我想它不存在.当然,这个问题的一个很好的答案是关于如何通过修改源代码来实现这种行为的提示和技巧,以及这个特性是否存在于其他类似的BDD框架中,如jBehave,NBehave或Cucumber?
今天,当测试失败时,输出结果如下:
Scenario: Logout when not logged in # features\logout.feature:6
Given I am not logged in # features\steps\logout.py:5
When I log out # features\steps\logout.py:12
Then the response status should be 401 # features\steps\login.py:18
Traceback (most recent call last):
File "C:\pro\venv\lib\site-packages\behave\model.py", line 1037, in run
match.run(runner.context)
File "C:\pro\venv\lib\site-packages\behave\model.py", line 1430, in run
self.func(context, *args, **kwargs)
File "features\steps\login.py", line 20, in step_impl
assert context.response.status == int(status)
AssertionError
Captured stdout:
api.new_session
api.delete_session
Captured logging: …Run Code Online (Sandbox Code Playgroud) 在我的调试器中检查.Net 4中的System.Net.ServicePointManager.DefaultConnectionLimit时,我看到非常高的数字.我在一台机器上看到24,在另一台机器上看到48.
对于新创建的ASP.NET MVC 3项目,即使没有对其进行任何配置更改,情况也是如此.这是一个错误吗?文档明确指出默认值为2:
ServicePoint对象允许的最大并发连接数.默认值为2.
DefaultNonPersistentConnectionLimit和DefaultPersistentConnectionLimit字段分别是更真实的4和2,但DefaultConnectionLimit数字似乎超出范围.
我开始学习.Net Core.我想写一个简单的'Hello World'控制台应用程序.
不幸的System.Console是最初没有.这是我的代码:
using System;
class Program
{
public static void Main()
{
Console.WriteLine("Hello from Mac");
}
}
Run Code Online (Sandbox Code Playgroud)
我应该安装什么包?
仅供参考,我正在使用Mac和VSCode以及.net核心rc1更新2.
我试图解析从json(例如.id: 4.5)到poco 的十进制值int,我想要一个异常.
Newtonsoft.Json.JsonSerializationException遇到小数时,这种反序列化会抛出,期望int:
httpContent.ReadAsAsync<MyCollection<T>>(
mediaTypeFormatters,
cancellationToken);
Run Code Online (Sandbox Code Playgroud)
MyCollection<T>是一个类型列表Result的类T,T可以有一个int.现在,我想抓住扔掉并保留其余部分的那些.所以我首先将它作为一个集合提取出来JObject,然后在try-catch中逐个解析它们.
var jObjectsMyCollection = await httpContent.ReadAsAsync<MyCollection<Newtonsoft.Json.Linq.JObject>>(
mediaTypeFormatters,
cancellationToken);
foreach (var j in jObjectsMyCollection.Results) {
try {
// now let's parse j one by one
Run Code Online (Sandbox Code Playgroud)
即使使用相同的格式化程序,我也无法以这种方式抛出:
这只是反序列化4.5to 4并且不抛出:
var jsonSerializer = JsonSerializer.Create(myMediaTypeFormatters.JsonFormatter.SerializerSettings);
j.ToObject<T>(jsonSerializer)
Run Code Online (Sandbox Code Playgroud)
与此相同:
var ser = myMediaTypeFormatters.JsonFormatter.CreateJsonSerializer();
tObjects.Add(ser.Deserialize<T>(j.CreateReader()));
Run Code Online (Sandbox Code Playgroud)
为了记录,在不同的两个不同的格式化程序设置如下:
myMediaTypeFormatters= new MediaTypeFormatterCollection();
myMediaTypeFormatters.JsonFormatter.SerializerSettings.Error += SerializationErrorHander;
myMediaTypeFormatters.JsonFormatter.SerializerSettings.ContractResolver = new SnakeCasePropertyNamesContractResolver();
myMediaTypeFormatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling …Run Code Online (Sandbox Code Playgroud) 我想以编程方式添加视图和按钮,如下所示.
问题是按钮在点击时没有反应.我的意思是它既不会突出显示也不会调用选择器.
原因是我想为录音(声音文件)实现列表行.列表行应该可以选择向下钻取并有一个播放按钮.所以我得到了一个RecordingView子类UIView,它本身使用构造函数中的目标添加按钮.见下面的代码.

如果有人有更好的方法来做到这一点,这也可能是一个解决方案.
@implementation MyViewController
- (IBAction) myAction {
RecordingView *recordingView = [[RecordingView alloc] initWithFrame:CGRectMake(30, 400, 130, 50)withTarget:self];
[recordingView setUserInteractionEnabled:YES];
[[self view] addSubview:recordingView];
}
Run Code Online (Sandbox Code Playgroud)
@implementation RecordingView
- (id)initWithFrame:(CGRect)frame withTarget:(id) target
{
self = [super initWithFrame:frame];
UIButton *playButton = [[UIButton alloc] initWithFrame:CGRectMake(185, 5, 80, 40)];
[playButton setTitle:@"Play" forState:UIControlStateNormal];
[playButton setTitleColor:[UIColor darkTextColor]forState:UIControlStateNormal];
// creating images here ...
[playButton setBackgroundImage:imGray forState: UIControlStateNormal];
[playButton setBackgroundImage:imRed forState: UIControlStateHighlighted];
[playButton setEnabled:YES];
[playButton setUserInteractionEnabled:YES];
[playButton addTarget: target
action: @selector(buttonClicked:)
forControlEvents: …Run Code Online (Sandbox Code Playgroud) 我刚刚从Amazon Marketplace上的Amazon Marketplace部署了Neo4J
我可以浏览到GUI,但是默认凭据(neo4j / neo4j)似乎不起作用。
错误消息显示为:
Neo.ClientError.Security.Unauthorized: The client is unauthorized due to authentication failure.
我想念什么?