我的应用程序中有很多框架.App在adhoc/enterprise发布中运行良好.只有当我提交到应用程序商店进行testflight测试时,我才会收到来自apple的错误电子邮件:
亲爱的开发者,
我们发现您最近发送的"我的应用名称"中存在一个或多个问题.要处理您的交付,必须纠正以下问题:
无效的捆绑包 - 您的应用程序引用的一个或多个动态库不在dylib搜索路径中.
一旦纠正了这些问题,您就可以重新更新已更正的二进制文件.
问候,
App Store团队
这里没有具体的信息.我该怎么调试呢?
我在Xcode中遇到了搜索(Command + Shift + F)功能的问题.我通过互联网搜索,但似乎没有找到解决方案.似乎只在特定项目上失败(我工作的其他项目看起来很好),我经常使用'搜索'选项.
我在Xcode搜索中有某种"缓存"吗?有没有办法重置?有任何想法吗?
在这里,我正在搜索我从项目中取出的字符串!所以我很肯定它应该在我的项目中返回一个位置.
通过对StackOverflow的研究,我了解到这个错误是由于尝试绑定一个不是可选的类型引起的,但是在这种情况下没有意义,因为它使用了guard.这是我的代码:
func animateTransition(_ transitionContext: UIViewControllerContextTransitioning) {
// Here, we perform the animations necessary for the transition
guard let fromVC = transitionContext.viewController(forKey: UITransitionContextFromViewControllerKey) else { return }
let fromView = fromVC.view
guard let toVC = transitionContext.viewController(forKey: UITransitionContextToViewControllerKey) else { return }
let toView = toVC.view
guard let containerView = transitionContext.containerView() else { return }
if self.presenting {
containerView.addSubview(toView)
}
let animatingVC = self.presenting ? toVC : fromVC
let animatingView = animatingVC.view
let appearedFrame = transitionContext.finalFrame(for: animatingVC)
var alpha: CGFloat = 1 …Run Code Online (Sandbox Code Playgroud) 我有一个UILabel和One UIView在Storyboard中并排包含其他子视图.UIView应该与UILabel的右边缘(尾随约束为1)对接,但我还需要UIlabel(左边的那个)来设置它的宽度等于它的内容大小,除非它达到最大宽度.视觉:
|标签文字| | UIViewWithSubviews |
我需要以下约束:
1)标签应该宽度调整宽度,除非它达到最大尺寸,高度也是动态的,这意味着当文本达到最大宽度时,自动换行会将句子分成另一行.和UIview将成为UIlabel的垂直.
2)UIView应始终与垂直中心的标签1的右边缘对接.
如何在Storyboard中进行设置?
提前致谢.
我在线上获得了exc_bad_access CIContext *context = [CIContext contextWithOptions:nil];
我已经启用了僵尸并用乐器检查:没有运气.
完整的代码是:
- (UIImage *) doBinarize:(UIImage *)sourceImage withThreshold:(float)threshold {
UIImage *newImage;
if (sourceImage){
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *image = [[CIImage alloc] initWithImage:sourceImage];
CIImage *cImg = [self AdaptiveThresholdFilter:image withThreshold:threshold];
CIImage *ciImage = cImg;
CGImageRef cgImage = [context createCGImage:ciImage fromRect:CGRectMake(0, 0, sourceImage.size.width, sourceImage.size.height)];
newImage = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage);
} else {
return nil;
}
return newImage;
}
Run Code Online (Sandbox Code Playgroud)
但是我发现几乎在我放置CIContext contextWithOptions行的任何地方,应用程序都会崩溃.
这是在iOS8.1,iPhone 5C上.应该注意的是iOS9或iOS10没有问题.
有什么建议?
我有一个应用程序,它具有动态生成的视图,并且每次加载视图时都可以不同.主视图包含一个设置为主视图边界的ScrollView.然后将子视图动态添加到ScrollView,但这些视图的高度将不同,并且它们可以随时更改高度(例如,用户单击视图的内容并更改).我想使用布局约束来确保每个视图保持与其上方的视图对齐,并使用一些任意填充.见下图:

现在所有填充值都设置为10(顶部,左侧和右侧).我正在使用他们的框架手动设置这些子视图的位置,但如果视图改变大小,这不起作用,所以我想改变它以使用NSLayoutConstraints,但我遇到了一些问题.
作为测试,我像之前一样设置子视图的框架,但后来我添加了约束:
// newView is created and its frame is initialized
self.scrlView?.addSubview(newView)
let constr = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: self.previousView, attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 10)
NSLayoutConstraints.activateConstraints([constr])
newView.translatesAutoResizingMaskIntoConstraints = false
self.previousView = newView
Run Code Online (Sandbox Code Playgroud)
但这些观点无处可见.我究竟做错了什么?所需要的只是确保每个视图的顶部在前一个视图下方对齐,并且无论视图高度如何,它们都保持这种状态.
此外,由于这些视图都被添加到滚动视图中,使用上面的布局约束如何设置滚动视图的正确内容大小?
我想要异步读取指定文件(来自相机胶卷的照片),但它对我不起作用.
变tempData变nil,直到我改变配置requestOptionForPhotos.synchronous来YES,然后一切都很好,但我不希望执行该代码同步.
是否有可能通过在其他线程中请求相同的文件来阻止对照片的访问?我是objective-c和iOS编程的新手,我不知道它是如何工作的.
NSURL *assetUrl = [[NSURL alloc] initWithString:filepath];
PHFetchResult *collection = [PHAsset fetchAssetsWithALAssetURLs:[NSArray arrayWithObject:assetUrl] options:nil];
PHImageRequestOptions *requestOptionForPhotos = [[PHImageRequestOptions alloc] init];
requestOptionForPhotos.networkAccessAllowed = YES;
requestOptionForPhotos.synchronous = NO;
__block BOOL isFinished = NO;
__block NSData * tempData = nil;
for(PHAsset *asset in collection) {
[[PHImageManager defaultManager]
requestImageForAsset:asset
targetSize:CGSizeMake(80, 80)
contentMode:PHImageContentModeAspectFill
options:requestOptionForPhotos
resultHandler:^(UIImage *result, NSDictionary *info) {
tempData = UIImagePNGRepresentation(result);
isFinished = YES;
}];
}
Run Code Online (Sandbox Code Playgroud) 我一直在寻找,如果我这样做,我是否需要做同步:
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kType];
Run Code Online (Sandbox Code Playgroud)
那之后,我该怎么办?:
[[NSUserDefaults standardUserDefaults] synchronize];
Run Code Online (Sandbox Code Playgroud)
在这件事上等你的答案.
我UIActionSheet在我的视图中呈现了一个,其中一个操作表的按钮显示了另一个操作表.当我在iPad上展示第二个操作表时,我在日志中收到此警告消息:
要求UIPopoverBackgroundVisualEffectView为其不透明度设置动画.这将导致效果出现断裂,直到不透明度返回到1.
这是我的代码:
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Option"] delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Sort", nil];
actionSheet.tag = 1;
[actionSheet showInView:self.view];
Run Code Online (Sandbox Code Playgroud)
在代表中:
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
[self showSortAction];
}
-(void)showSortAction {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Sort By" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"A-Z", @"Z-A", @"Newer to older", @"Older to newer", nil];
actionSheet.tag = 2;
[actionSheet showInView:self.view];
}
Run Code Online (Sandbox Code Playgroud) 我想生成一个给定字符串的单词列表,其中每个列出的单词至少包含一个大写字母.
有这样一个字符串:
let str: String = "Apple watchOS 3 USA release date and feature rumours."
Run Code Online (Sandbox Code Playgroud)
我想得到一个像这样的数组:
var list: [String] = ["Apple", "watchOS", "USA"]
Run Code Online (Sandbox Code Playgroud)
做这个的最好方式是什么?
ios ×8
swift ×3
autolayout ×1
core-image ×1
ios8 ×1
ipad ×1
objective-c ×1
optional ×1
string ×1
swift3 ×1
testflight ×1
xcode ×1