我将准备在下个月开始测试我的iPhone应用程序,我想我应该期待它崩溃一两次.将崩溃报告 - 以及我能提供的任何支持信息 - 都归还给母舰将是一件好事.理想情况下,这对beta测试人员来说几乎不需要工作.
有工具和方法.到目前为止,对我来说,最有前途的竞争者是CrashKit.我也看过Crash Reporter.我从2008年开始回顾这些Craig Hockenberry的帖子("备份调试","符号化").
我忽略了一些明显的东西吗 人们还有什么进一步的建议吗?
考虑ReactiveCocoa简介中的一个示例(释义),该示例根据.password和.passwordConfirm文本字段是否匹配来启用:
RAC(self.enabled) = [RACSignal
combineLatest:@[ RACAble(self.password), RACAble(self.passwordConfirm) ]
reduce:^(NSString *password, NSString *passwordConfirm) {
return @([passwordConfirm isEqualToString:password]);
}];
Run Code Online (Sandbox Code Playgroud)
在这里,我们在编译时知道我们正在组合多少和什么东西,并且将"combine"数组解构/映射到reduce块的多个参数是有用的.什么时候不起作用.例如,如果你想:
RAC(self.enabled) = [RACSignal
combineLatest:arrayOfSignals
reduceAll:^(NSArray *signalValues) { // made this up! don't try at home.
// something ...
}];
Run Code Online (Sandbox Code Playgroud)
你如何用ReactiveCocoa做到这一点?
更新:接受的答案的评论有助于解释我所缺少的内容.
我收到了这个错误. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionViewCell label]: unrecognized selector sent to instance 0x1eead660'我正在使用一个nib文件作为我的单元格并尝试正确显示单元格.我猜我没有正确地返回细胞,但我不太确定.任何帮助将不胜感激.
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"Cell"];
Cell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
NSMutableArray *data = [sections objectAtIndex:indexPath.section];
cell.label.text = [data objectAtIndex:indexPath.item];
return cell;
}
Run Code Online (Sandbox Code Playgroud) 我们的iPad应用程序已被拒绝从应用程序商店进行私人/限制来电/使用dyld_stub_binding_helper.我可以在这里找到最明确的信息.
我们的代码没有直接引用这个,除了与Apple播放20个问题外,我们不知道如何继续.以前有人遇到过这个问题吗?
我编写了一个REST服务来提供一些数据.它受密码保护.
我正在尝试编写一个后台进程,它将获取数据并将其填充到我在应用程序中的sqlLite数据库中.
我最初没有使用身份验证执行此操作
- (void) callWebService {
dispatch_sync(kBgQueue, ^{
NSData* data = [NSData dataWithContentsOfURL:
scoularDirectoryURL];
[self performSelectorOnMainThread:@selector(fetchedData:) withObject:data waitUntilDone:YES];
});
}
Run Code Online (Sandbox Code Playgroud)
这工作正常,但我不认为我可以添加身份验证.如果可以,我会用它.
我正在寻找的是使用用户/密码认证的NSURLSession的一个很好的简单解释.
我正在玩NSURLSession的教程.我可以成功下载图像,但下载进度和下载完成的代表不会触发.这是代码:
- (void)viewDidLoad
{
[super viewDidLoad];
NSString * imageUrl = @"http://ichef.bbci.co.uk/naturelibrary/images/ic/credit/640x395/r/ro/rock_pigeon/rock_pigeon_1.jpg";
NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession * session = [NSURLSession sessionWithConfiguration:sessionConfiguration delegate:self delegateQueue:nil];
//Download image.
NSURLSessionDownloadTask * getImageTask = [session downloadTaskWithURL:[NSURL URLWithString:imageUrl]
completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"Error sadly for you is %@", [error localizedDescription]);
}
UIImage * downloadedImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:location]];
dispatch_async(dispatch_get_main_queue(), ^ {
self.imageView.image = downloadedImage;
});
}];
[getImageTask resume];
// Do any additional setup after loading the view, typically from …Run Code Online (Sandbox Code Playgroud) 这肯定是其中一个错误,你一直盯着代码,这么久,你找不到错误.
我有这个代码块,我循环遍历NSMutableArray,包含多个NSMutableArrays:
// FoodViewController.m
#import "FoodViewController.h"
@interface FoodViewController ()
@property (strong,nonatomic) NSMutableArray *breakfast;
@end
@implementation FoodViewController
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *meals = [[dbManagerClass getSharedInstance]findCurrentDay];
for (NSMutableArray *row in meals) {
[self.breakfast addObject:row];
}
NSLog(@"%@",self.breakfast);
}
@end
Run Code Online (Sandbox Code Playgroud)
我可以看到ii在我的*餐中有一些东西,因为我从NSLog获得以下信息:
(
(
2,
Dinner,
Pizza,
574,
"20.03.2014",
empty
),
(
3,
Breakfast,
"Buttered toast",
394,
"20.03.2014",
empty
)
Run Code Online (Sandbox Code Playgroud)
但不知怎的,它没有被添加到早餐-NSMutableArray中,因为NSLog返回"null".
在Objective-C中,我可能会使用+[NSValue valueWithNonretainedObject:]保留对象的唯一ID,我不希望保留对象本身.似乎对Swift不赞成.
在Swift怎么办?
我试图在 json-schema 中完成的是:当属性enabled是 时true,应该需要某些其他属性。当 时false,应该禁止这些属性。
这是我的 json 架构:
{
"type": "object",
"properties": {
"enabled": { "type": "boolean" }
},
"required" : ["enabled"],
"additionalProperties" : false,
"if": {
"properties": {
"enabled": true
}
},
"then": {
"properties": {
"description" : { "type" : "string" },
"count": { "type": "number" }
},
"required" : ["description", "count"]
}
}
Run Code Online (Sandbox Code Playgroud)
使用ajv6.5 版进行验证count,无论 的值如何,这都会导致 require等enabled。例如,对于数据:
{ "enabled": false }
Run Code Online (Sandbox Code Playgroud)
我的验证错误是:
[ { keyword: …Run Code Online (Sandbox Code Playgroud) objective-c ×5
ios ×4
iphone ×2
nsurlsession ×2
ajv ×1
app-store ×1
cocoa-touch ×1
crash ×1
debugging ×1
dicom ×1
foundation ×1
ios7 ×1
jsonschema ×1
nsvalue ×1
swift ×1
xcode ×1