我在调试器中收到错误.在Thread我的应用程序崩溃在线:
0x37265f78: ldr r3, [r4, #8]
Run Code Online (Sandbox Code Playgroud)
有:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x50000008)
Run Code Online (Sandbox Code Playgroud)
如何找出应用程序实际崩溃的位置?有一个类似"调用堆栈"的东西?
我需要使用AFNetworking这个问题来构建这样的URL ,{以及}如何通过parameter
/api/sth.json?filter[condition]={"53891":[123],"53892":[123,124]}
Run Code Online (Sandbox Code Playgroud)
所以我的代码看起来像这样(我更简单):
[self GET:myUrl parameters:@{
@"filter" : @{
@"condition" : @{
@"53891" : @[@(123)],
@"53892" : @[@(123),@(124)]}
},
} success:^(AFHTTPRequestOperation *operation, id responseObject) {
success(operation,responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
failure(operation,error);
}];
Run Code Online (Sandbox Code Playgroud)
但它产生的不是预期的产量:
/api/sth.json?filter[condition][53891][]=123&filter[condition][53892][]=123&filter[condition][53892][]=124
Run Code Online (Sandbox Code Playgroud)
有一种方法可以在parametersin AFHTTPRequestOperation或手动我必须把它放入字符串?
编辑:
我目前的解决方案是这样的:
+(NSString*)convertFromDictionary:(NSDictionary*)dic {
NSMutableString *outputStr = [NSMutableString new];
[outputStr appendString:@"{"];
NSArray *allKeys = [[dic allKeys] sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:nil ascending:NO]]];
for(NSString *key in allKeys) {
NSArray *objects = dic[key];
[outputStr appendString:[NSString stringWithFormat:@"\"%@\":[",key]]; …Run Code Online (Sandbox Code Playgroud) 我想显示来自后端的数据所以让我们有一个示例json文件:
{
"fonts": [
{
"name": "Helvetica",
"styleIdentifier": "H0",
"size": 17
},
{
"name": "Helvetica",
"styleIdentifier": "H1",
"size": 14
},
{
"name": "Helvetica-Bold",
"styleIdentifier": "H0Bold",
"size": 17
},
{
"name": "HelveticaNeue-Light",
"styleIdentifier": "H0Light",
"size": 40
}
]
}
Run Code Online (Sandbox Code Playgroud)
所以我创建了一个relationship(很多 - 多个)ordered选项.通过输入我看到它总是以相同的方式写入Core Data,但是当我尝试获取它时
configuratation.fonts这里fonts是NSOrderedSet我得到了完全地随机顺序的项目.我想念某个规格?或者我应该以某种方式排序?
__编辑__
首先,当我从上面的json获取数据时,我有一个空字体关系的配置集.然后我获取它并将其插入到核心数据中:
NSMutableArray *returnArray = [NSMutableArray new];
for(NSDictionary *fontDictionary in jsonArray) {
Font *fontObj = [Font font:fontDictionary inContext:context];
[returnArray addObject:fontObj];
}
Run Code Online (Sandbox Code Playgroud)
并且在此数组中数据的顺序正确.然后在配置对象中我将其添加到NSOrderedSet:
-(void)appendTracks:(NSArray<Font*>*)fontArray {
self.fonts = …Run Code Online (Sandbox Code Playgroud) 我现在正面临为项目的第二个版本选择依赖管理器.我做我的功课,检查,我需要为所有的依赖迦太基支持,原来的一切,而不面料及Crashlytics.对于这两个我宁愿得到一些额外的工作,而不是整合整个cocoapods.
所以我的问题是 - 我可以创建一个示例项目,我将放在github上并制作一个自动构建动态方案,允许我.framework在项目中集成第三方文件吗?
所以我的出发点是制作一个脚本来检查网站中pod的版本,并检查我下载的文件是否是最新版本.那已经完成了.但我有一个.framework文件,如何将其嵌入到xcode项目中以支持carthage?
在将其标记为重复之前,请注意,我确实阅读了此内容,但这似乎不适用于UITabBar
双方UIViewController并UITabBar以编程方式创建。约束设置如下:
public override func viewDidLoad() {
super.viewDidLoad()
self.view.bringSubview(toFront: self.tabBar)
}
Run Code Online (Sandbox Code Playgroud)
并且self.tabBar:
lazy var tabBar: UITabBar = {
let tab = UITabBar()
self.view.addSubview(tab)
tab.translatesAutoresizingMaskIntoConstraints = false
tab.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true
tab.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
tab.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true //This line will change in second part of this post.
return tab
}()
Run Code Online (Sandbox Code Playgroud)
这个节目UITabBar是这样的:
而且它太小了,因为它没有考虑安全区域。所以我确实改变了线路:
tab.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
Run Code Online (Sandbox Code Playgroud)
到:
tab.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor).isActive = true
Run Code Online (Sandbox Code Playgroud)
然后显示如下:
所以它也没有按预期显示。这里的目标是这样的:
如何制作约束以显示UITabBar这样的内容?
如何获得真正的价值Greater Than on Equal NSLayoutConstraint。
当您获取constant参数时,运行时的约束明显大于该值,它仍然返回尽可能低的值
我想创建Xcode插件,我从Alcatraz中选择Xcode插件模板,然后我关闭项目添加Podfile打开工作区并尝试构建我每次都得到ann错误:
ld: library not found for -lDTXcodeUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
这是一个完整的输出:
Ld /Users/jakubmazur/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/CreateFilesPlugin.xcplugin/Contents/MacOS/CreateFilesPlugin normal x86_64 cd /Users/jakubmazur/Developer/CreateFilesPlugin export MACOSX_DEPLOYMENT_TARGET=10.10 /Users/jakubmazur/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Users/jakubmazur/Desktop/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Products/Debug -F/Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Products/Debug -filelist /Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Intermediates/CreateFilesPlugin.build/Debug/CreateFilesPlugin.build/Objects-normal/x86_64/CreateFilesPlugin.LinkFileList -mmacosx-version-min=10.10 -ObjC -lDTXcodeUtils -lXcodeEditor -fobjc-arc -fobjc-link-runtime -framework AppKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Intermediates/CreateFilesPlugin.build/Debug/CreateFilesPlugin.build/Objects-normal/x86_64/CreateFilesPlugin_dependency_info.dat -o /Users/jakubmazur/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/CreateFilesPlugin.xcplugin/Contents/MacOS/CreateFilesPlugin
ld:找不到-lDTXcodeUtils clang的库:错误:链接器命令失败,退出代码为1(使用-v查看调用)
知道我该怎么办呢?
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :osx
pod "DTXcodeUtils"
Run Code Online (Sandbox Code Playgroud) 我有一些带有旧证书的帐户,用于当前正在生产的应用程序。它不是这个问题的重复(Xcode 苹果开发者证书到期:(0xE8008018)),因为我确切地知道该怎么做,但它会造成什么危害。由于我没有用于创建此证书的 CSR 文件,因此应用程序使用了大量推送通知。
吊销证书会破坏推送通知吗?
签约又是什么?如果我撤销证书,我必须在推送到存储之前重新生成配置文件?
当我在那里吊销证书时会发生什么?
xcode certificate push-notification apple-push-notifications ios
我正在开发 SDK 并尝试捕获应用程序终止Notification。很容易将其作为(ex)的闭包NSNotification.Name.UIApplicationWillResignActive
self.resignActiveNotification = NotificationCenter.default.addObserver(forName: NSNotification.Name.UIApplicationWillResignActive,
object: nil,
queue: nil) { _ in
//something goes here and it works like a charm.
}
Run Code Online (Sandbox Code Playgroud)
所以我想有类似的终止行为:
self.terminateNotification = NotificationCenter.default.addObserver(forName: NSNotification.Name.UIApplicationWillTerminate,
object: nil,
queue: nil) { _ in
NSLog("%@",#function)
}
Run Code Online (Sandbox Code Playgroud)
而这个永远不会被调用!
当然,如果我输入AppDelegate:
func applicationWillTerminate(_ application: UIApplication) {
//termination
}
Run Code Online (Sandbox Code Playgroud)
它会工作,但由于我正在构建一个 SDK,我无法使用 AppDelegate 方法。有没有办法获得终止关闭调用?或者任何其他方式知道应用程序即将终止?
在Apple 文档中,您可以找到:
调用此方法后,应用程序还会发布 UIApplicationWillTerminate 通知,让感兴趣的对象有机会响应转换。
然而这似乎被打破了
ios ×9
objective-c ×4
xcode ×4
swift ×3
autolayout ×2
afnetworking ×1
app-store ×1
carthage ×1
certificate ×1
cocoapods ×1
core-data ×1
uitabbar ×1