今天,更新Xcode并安装macOS更新后,出现了以前不存在的错误。
我的Watch Extension应用程序现在包含错误:
我还没有找到答案,为什么会这样。在设备上工作正常。模拟器甚至不会构建。
该应用程序使用watchOS 2.0和iOS 9.0。
在新的iOS11中,我得到了一些奇怪的例外.我不明白为什么会这样.在之前的iOS中,没有这样的例外.附加日志:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x180a5e7e8 object_isClass + 16
1 Foundation 0x181f013e8 KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 68
2 Foundation 0x181eff8ec NSKeyValueWillChangeWithPerThreadPendingNotifications + 300
3 QuartzCore 0x18555a6dc CAAnimation_setter(CAAnimation*, unsigned int, _CAValueType, void const*) + 156
4 QuartzCore 0x18555d388 -[CAPropertyAnimation setKeyPath:] + 32
5 UIKit 0x18a9b1a08 -[UIImageView startAnimating] + 876
6 UIKit 0x18a9b0e78 -[UIActivityIndicatorView startAnimating] + 48
7 UIKit 0x18a9b0174 -[UIActivityIndicatorView _didMoveFromWindow:toWindow:] + 212
8 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
9 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
10 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + …Run Code Online (Sandbox Code Playgroud)如何从iСloud访问全尺寸图像?每次我尝试拍摄这张照片时,我都会得到256x342的图像尺寸.我也没有看到进展.
码:
PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetIdentifier] options:nil];
PHImageManager *manager = [PHImageManager defaultManager];
[result enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL *stop) {
PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
options.synchronous = YES;
options.networkAccessAllowed = YES;
options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
NSLog(@"%f", progress);
};
[manager requestImageForAsset:asset targetSize:PHImageManagerMaximumSize contentMode:PHImageContentModeDefault options:options resultHandler:^(UIImage *resultImage, NSDictionary *info)
{
UIImage *image = resultImage;
NSLog(@"%@", NSStringFromCGSize(resultImage.size));
}];
}];
Run Code Online (Sandbox Code Playgroud)
直到我点击照片应用程序中的图片,这张图片质量很差.但是一旦我点击图片,它就会在设备上下载,并且质量非常全.
当我向AppStore提交构建时,我看到错误:
ERROR ITMS-4088:"在SofwareAssets中找不到带有apple_id:*的软件"
ERROR ITMS-4238:"冗余二进制上传.在SoftwareAssets/PreReleaseSoftwareAsset上已存在用于列车'3.0'的构建版本'3.0'的二进制上传.
有人知道我该怎么做才能解决这个问题吗?
如果我尝试使用以下代码订阅CloudKit:
NSPredicate *truePredicate = [NSPredicate predicateWithValue:YES];
CKSubscription *itemSubscription = [[CKSubscription alloc] initWithRecordType:RecordType
predicate:truePredicate
options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate | CKSubscriptionOptionsFiresOnRecordDeletion];
CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
notification.alertBody = @"Item Added/Updated/Deleted!";
itemSubscription.notificationInfo = notification;
[self.publicDatabase saveSubscription:itemSubscription completionHandler:^(CKSubscription *subscription, NSError *error) {
if (error) {
// In your app, handle this error appropriately.
NSLog(@"An error occured in %@: %@", NSStringFromSelector(_cmd), error);
} else {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:subscription.subscriptionID forKey:kSubscriptionID];
[defaults synchronize];
}
}];
Run Code Online (Sandbox Code Playgroud)
我有时会收到此错误:
CKError 0x17558460:"服务器拒绝请求"(15/2000); server message ="内部服务器错误"; uuid = …
我创建了一个创建和更新订阅.创作总是很完美,我从其他设备获得推送通知.更新发送到iCloud,您可以在那里看到它们,但推送通知不会传递给设备.
- (void)subscribeWithType:(NSString*)type completionHandler:(void(^)(CKSubscription *))completionHandler
{
if (self.enabled == NO || _available == NO || _reachability.currentReachabilityStatus != ReachableViaWiFi)
{
if (completionHandler)
{
dispatch_async(dispatch_get_main_queue(), ^{
completionHandler(nil);
});
}
return;
}
NSPredicate *truePredicate = [NSPredicate predicateWithValue:YES];
CKSubscriptionOptions options = CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate;
CKSubscription *subscription = [[CKSubscription alloc] initWithRecordType:type
predicate:truePredicate
subscriptionID:[CTUtils GetUUID]
options:options];
CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
notification.shouldSendContentAvailable = YES;
notification.alertLocalizationKey = @"";
notification.shouldBadge = NO;
subscription.notificationInfo = notification;
CKModifySubscriptionsOperation *operation = [[CKModifySubscriptionsOperation alloc] initWithSubscriptionsToSave:@[subscription] subscriptionIDsToDelete:nil];
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__block …Run Code Online (Sandbox Code Playgroud) push-notification apple-push-notifications ios cloudkit cksubscription
每当我尝试注册订阅时,我都会收到错误:CKError 0x19030580: "Service Unavailable" (6/2022); server message = "refused to install an older schema (68f93710-7456-11e4-b13e-008cfac0c800) since we already have 693359e0-7456-11e4-8e42-008cfac03128"; uuid = 42F42F6B-98FB-4774-B735-271C1AEF07F1; container ID = "iCloud.com.*.*".当我尝试获取服务器上的所有订阅时,我什么也得不到.
为什么我收到CKError 0x19030580?为什么我无法检索订阅?我应该怎么解决它们?
码:
NSPredicate *truePredicate = [NSPredicate predicateWithValue:YES];
CKSubscription *itemSubscription = [[CKSubscription alloc] initWithRecordType:ItemAssetRecordType
predicate:truePredicate
options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate];
CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
notification.shouldSendContentAvailable = YES;
notification.alertLocalizationKey = @"New Item available.";
notification.shouldBadge = NO;
itemSubscription.notificationInfo = notification;
[self.privateDatabase saveSubscription:itemSubscription completionHandler:^(CKSubscription *subscription, NSError *error) {
if (error) {
} else { …Run Code Online (Sandbox Code Playgroud) 我不太了解有关订阅的信息.我有私人数据库.我创建了一个订阅表.如果我在一个iCloud帐户下订阅了两个设备,则会发生错误:订阅时出错:
CKError 0x165c6ac0:"服务器拒绝请求"(15/2032); server message ="订阅与'C6051A24-2DB5-47EA-98D2-7D8786AA6D3B'重复"; uuid = 48AC7472-006A-4FD7-84A9-DB342C83C199; container ID ="iCloud.com.*.*"
NSPredicate *truePredicate = [NSPredicate predicateWithValue:YES];
CKSubscription *itemSubscription = [[CKSubscription alloc] initWithRecordType:RecordType
predicate:truePredicate
options:CKSubscriptionOptionsFiresOnRecordCreation | CKSubscriptionOptionsFiresOnRecordUpdate];
CKNotificationInfo *notification = [[CKNotificationInfo alloc] init];
notification.shouldSendContentAvailable = YES;
notification.alertLocalizationKey = @"";
notification.shouldBadge = NO;
itemSubscription.notificationInfo = notification;
[self.privateDatabase saveSubscription:itemSubscription completionHandler
Run Code Online (Sandbox Code Playgroud)
也许我做错了什么?我需要对两台设备做什么才能收到订阅通知?
编辑:
也.我只创建一个订阅.如果我使用方法fetchAllSubscriptionsWithCompletionhandler,我会看到每个表的3-4个订阅.但这很奇怪,因为我只创造了一个.当我收到通知时,我会看到更多通知.
我有两个UIViewController.第一个控制器仅用于纵向,它包含UIScrollView.第二个控制器仅用于横向.当我尝试从第一个屏幕打开第二个屏幕时,UIScrollView内容在第一个控制器上被X移动到-44.此行为仅适用于iPhone X.有谁知道为什么会发生这种情况?
ios ×7
cloudkit ×4
ios8 ×4
ios11 ×2
crash ×1
frameworks ×1
iphone-x ×1
objective-c ×1
xcode ×1
xcode6 ×1