我的iOS应用程序存在很大问题:它有时会在没有详细调试错误的情况下崩溃.堆栈跟踪为空.这些是堆栈跟踪中仅有的两行:
在com.apple.main-thread
.
Xcode调试器上的错误(连接设备):
malloc: *** error for object 0x208a7614: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Run Code Online (Sandbox Code Playgroud)
我在malloc_error_break中使用libsystem_c.dylib设置了断点,没有来自调试器的任何反馈.我不知道要解决这个问题.
我使用Xcode 8.0 beta来测试我的应用程序,但在将我的代码2.2转换为3.0之后,出现了许多未解决的错误.在演示下面,Xcode8.0出现错误消息
1.在"如果"条件之后预期"{"
if annotation.isKindof: (MKUserLocation) {
return nil
}
Run Code Online (Sandbox Code Playgroud)
第二个错误是地图套件...我使用iskind(of:MKUserLocation)仍然无法解决,它会出现另一个错误消息
2.Braced语句块是一个未使用的闭包
if annotation.isKindof: (MKUserLocation) {
return nil
}
Run Code Online (Sandbox Code Playgroud)
3.在通话中缺少参数标签'of:'
if annotation.isKind(of: MKUserLocation) {
return nil
}
Run Code Online (Sandbox Code Playgroud) 我有一个原型单元,我把UIVisualEffectView
它放在里面ContentView
.视觉效果视图的模糊风格很暗,而且Vibrancy关闭.然后我使用IB将视觉效果视图的alpha设置为0.5.
然后在运行时,我收到一条警告:
<UIVisualEffectView ...> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
Run Code Online (Sandbox Code Playgroud)
我无法理解为什么会出现此警告以及如何正确设置此alpha属性.
从最新的Xcode Beta 6安装构建时,我看不到iOS AppIcon.可能的错误是什么?
我已经包含了必需的图标大小,包括1024x1024.
我已在String Extension中编写此函数,但无法找出错误.
func isEmail() -> Bool {
let regex = NSRegularExpression(pattern: "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$", options: [.CaseInsensitive])
return regex.firstMatchInString(self, options: nil, range: NSMakeRange(0, characters.count)) != nil
}
Run Code Online (Sandbox Code Playgroud)
错误是:
调用可以抛出,但它没有标记为'try',并且没有处理错误
我用CocoaPods v0.36
我的Swift
项目及以下荚:Alamofire
,CocoaLumberjack
,SwiftyJSON
.
一切都很好,直到我使用我的开发者ID.编译器开始遇到编译项目的问题,在CocoaPods
我的项目编译的一些修复和更新之后编译,但在运行时我收到以下错误:
dyld: Library not loaded: @rpath/Alamofire.framework/Versions/A/Alamofire
Referenced from: /Users/Ivan/Library/Developer/Xcode/DerivedData/myApp-bsxfcnwqpaxnzbhencwzteasshzf/Build/Products/Debug/myApp.app/Contents/MacOS/myApp
Reason: image not found
Run Code Online (Sandbox Code Playgroud)
我阅读了与此相关的不同帖子:
但似乎没有人能解决这个问题.
我唯一的线索是3个框架是红色的,所以似乎没有生成/链接.
现在,我删除了我的开发者ID,但问题仍然存在.有人有想法吗?
我想从当前的图形上下文创建一个UIImage对象.更具体地说,我的用例是用户可以绘制线条的视图.他们可以逐步绘制.完成后,我想创建一个UIImage来代表他们的绘图.
这是drawRect:现在对我来说是这样的:
- (void)drawRect:(CGRect)rect
{
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSaveGState(c);
CGContextSetStrokeColorWithColor(c, [UIColor blackColor].CGColor);
CGContextSetLineWidth(c,1.5f);
for(CFIndex i = 0; i < CFArrayGetCount(_pathArray); i++)
{
CGPathRef path = CFArrayGetValueAtIndex(_pathArray, i);
CGContextAddPath(c, path);
}
CGContextStrokePath(c);
CGContextRestoreGState(c);
}
Run Code Online (Sandbox Code Playgroud)
...其中_pathArray的类型为CFArrayRef,并且每次调用touchesEnded:时都会填充.另请注意,drawRect:可以在用户绘制时多次调用.
用户完成后,我想创建一个表示图形上下文的UIImage对象.有关如何做到这一点的任何建议?
我在向App Store提交时遇到问题.当我尝试导出.ipa或在应用程序归档后使用提交功能时,Xcode 6.1和5.1.1都会崩溃.以下是重现的步骤:
构建 - >存档 - >管理器 - >导出 - >保存iOS App Store部署
"提取队列表......"对话框暂时出现,然后Xcode崩溃.单击"管理器"窗口上的"提交"按钮时也会发生这种情况.对于Ad Hoc导出也会发生这种情况.这很奇怪,因为几天前我能够创建一个临时发布而没有问题.
我也无法在项目文件常规设置中选择目标的Team属性(常规 - >身份 - >团队).
上述所有问题的崩溃报告都是类似的.我仔细检查了开发人员中心,以确保我有一个App Store配置文件.如果他们没有同意最新的开发人员中心条款,我也会读到有类似问题的人.据我所知,我没有任何需要采取行动的未决协议.我已经尝试从Xcode中删除我的帐户并重新安装.我猜这是一个帐户问题,但我不知道我能做些什么来解决它.
有没有办法从iPhone收件箱(SMS)访问数据到ios应用程序进行自动OTP验证,如Android中的那样?我将非常感谢你的帮助.
如何更改未选中的UITabBarItem标题和背景图像iOS 8的tintColor?
未选择状态的默认颜色为浅灰色,但在我的暗色UITabBar背景上不显示
我希望我的未选择状态有[UIColor blackColor]的颜色
在我的应用程序委托内部完成了完成任务:我有
UIImage *deselectedE = [[UIImage imageNamed:@"mincraft_axe_green_32.png"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
UIImage *selectedE = [[UIImage imageNamed:@"mincraft_axe_green_32.png"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
e.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Profile" image:deselectedE selectedImage:selectedE];
[[UITabBar appearance] setTintColor:[UIColor blackColor]];
Run Code Online (Sandbox Code Playgroud) ios ×9
xcode ×3
ios8 ×2
iphone ×2
swift ×2
swift3 ×2
app-store ×1
bartintcolor ×1
c ×1
cocoa ×1
cocoapods ×1
crash ×1
foundation ×1
ios12 ×1
malloc ×1
objective-c ×1
sms ×1
tintcolor ×1
uiblureffect ×1
uiimage ×1
uitabbaritem ×1