小编P5y*_*cH0的帖子

Parse.com错误'启用固定时不允许使用方法'.当我使用PFQueryTableViewController子类时

我目前正在使用1.6.1通过CocoaPods(=最新)

在我的swift项目中,我启用了localdatastore,然后设置了解析应用程序ID.之后,我加载一个故事板,它是一个PFQueryTableViewController子类.真的没什么特别的.但它仍然崩溃.它似乎在Parse内部崩溃[PFQuery setCachePolicy:]

可能有什么不对?如何使离线功能正常工作?

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Method not allowed when Pinning is enabled.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001078a0f35 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000107ea3bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x00000001078a0e6d +[NSException raise:format:] + 205
    3   NMC-Goes                            0x00000001044abe44 -[PFQuery setCachePolicy:] + 35
    4   NMC-Goes                            0x00000001043f6e85 -[PFQueryTableViewController queryForTable] + 341
    5   NMC-Goes                            0x00000001043f712e -[PFQueryTableViewController loadObjects:clear:] + 110
    6   NMC-Goes                            0x00000001043f70ba -[PFQueryTableViewController loadObjects] + 58
    7   NMC-Goes                            0x00000001043f69f9 -[PFQueryTableViewController viewDidLoad] + 73 …
Run Code Online (Sandbox Code Playgroud)

objective-c ios parse-platform swift ios8

9
推荐指数
2
解决办法
5682
查看次数

为什么我得到'No -renderInContext:找到方法'警告?

我在-renderInContext上收到编译器警告:

- (UIImage *) imageFromView:(UIView *)view {
    UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()]; 
    UIImage * img = UIGraphicsGetImageFromCurrentImageContext();    
    UIGraphicsEndImageContext();
    return img; 
}
Run Code Online (Sandbox Code Playgroud)

我在项目框架中有QuartzCore,代码可以工作.如何修复代码以便停止向我发出警告?

我得到的确切警告是

warning: no '-renderInContext:' method found
warning: (Messages without a matching method signature
warning: will be assumed to return 'id' and accept
warning: '...' as arguments.)
Run Code Online (Sandbox Code Playgroud)

iphone ios

8
推荐指数
1
解决办法
6191
查看次数

Xcode 索引需要很长时间并使用千兆字节的内存

我有一个小项目,它需要很长时间才能被索引,并且在索引时使用了大量的内存。在屏幕截图中,您可以看到两个使用 160+ GB 内存的 Swift 进程。我只在一个项目中有这个问题。顺便说一句,该项目使用 CocoaPods。

现在,如果我密切关注活动监视器并及时终止进程(在它们占用太多内存以冻结 Mac 之前),最终该项目已被索引,我可以对其进行处理。

这种内存行为的原因可能是什么,我该如何预防?

[Catalina 10.15.1 (19B88)、CocoaPods 1.8.4 上的 Xcode 版本 11.2.1 (11B500)]

PS 做通常的清理和删除派生数据根本没有帮助。

荒谬的

xcode cocoapods swift

8
推荐指数
1
解决办法
1267
查看次数

如何防止在Release build和Debug build中使用Settings.bundle?

我需要在我们的调试版本中有一个settings.bundle,但不希望在我们的Release中有它.我该如何处理?是否有我可以用来从复制包资源构建阶段删除它的脚本?

iphone debugging release settings.bundle

7
推荐指数
2
解决办法
3913
查看次数

在调试cocoapod pod时,在xcode的变量视图中清空变量

我在项目中调试swift pod时遇到问题.我们创建了一个swift pod,并将其集成到我们的一个项目中作为开发pod.一切都很好.但是,当我们尝试调试pod中的代码时,我们看不到任何值.

我已经检查过,我们不会在Pods项目中或主项目中删除调试符号.还有什么可能是错的.我们如何解决这个问题?

变量视图

以下是我变量时的一些输出:

在此输入图像描述

以下是我的项目的构建(不是Pods项目)

在此输入图像描述

xcode cocoapods swift

7
推荐指数
1
解决办法
309
查看次数

需要在[self.tableView endUpdates]完成动画后执行reloadSections

我需要表演

[[self tableView] reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone];
Run Code Online (Sandbox Code Playgroud)

后

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
// The fetch controller has sent all current change notifications, so tell the table view to process all updates.
    [self.tableView endUpdates];    
}
Run Code Online (Sandbox Code Playgroud)

完成了动画制作.

我想这样做,因为当从节中删除单元格时,我需要重新配置节中的一些单元格.这是因为该部分的第一个和最后一个单元格具有与它们之间的单元格不同的背景.单个单元格具有不同的背景.如果我不重新配置该部分中剩余的单元格,则可能导致一个难看的视图.

在controllerDidChangeContent期间调用reloadSections太快而崩溃,因为无法再找到一个单元格.

iphone uitableview

6
推荐指数
1
解决办法
2万
查看次数

Git"无法合并二进制文件"错误在持续集成构建中

我们有一个自动化系统,它将我们的开发分支合并到一个发布分支中.

合并是通过命令完成的git merge -s recursive -X theirs development.

我们遇到的问题是,在将开发合并到发布时,合并在二进制文件上失败.

错误是:" warning: Cannot merge binary files: Resources/Main/Images/image.png (HEAD vs. development)".

如何在没有用户交互的情况下合并两个分支?从开发到发布的所有内容都可以"赢得"合并.

git merge binaryfiles

6
推荐指数
1
解决办法
2242
查看次数

从embedded.mobileprovision配置文件获取证书到期日期

我需要使用命令行获取ipa的embedded.mobileprovision文件中使用的iOS企业证书的到期日期.

到目前为止我有这个:

security cms -D -i Payload/*.app/embedded.mobileprovision > tmp.plist && /usr/libexec/PlistBuddy -c 'Print :DeveloperCertificates' tmp.plist | base64 -d - | openssl x509 -inform DER -noout -text
Run Code Online (Sandbox Code Playgroud)

响应:

Apr 22 12:28:47 c01892 base64[14721] <Info>: Read 510 bytes.
Apr 22 12:28:47 c01892 base64[14721] <Info>: Wrote 680 bytes.
Apr 22 12:28:47 c01892 base64[14721] <Info>: Read 510 bytes.
Apr 22 12:28:47 c01892 base64[14721] <Info>: Wrote 680 bytes.
Apr 22 12:28:47 c01892 base64[14721] <Info>: Read 440 bytes.
Apr 22 12:28:47 c01892 base64[14721] <Info>: Wrote 588 …
Run Code Online (Sandbox Code Playgroud)

bash ios provisioning-profile

6
推荐指数
1
解决办法
1836
查看次数

在 Xcode 中复制文件

我在 Xcode 中创建了一些文件。现在我想复制其中的一些。我该怎么做?

目前,我在 Finder 中复制它们并将它们复制回 Xcode 以便处理它们。一定会有更好的办法。

xcode copy file

5
推荐指数
1
解决办法
7729
查看次数

在快速的代理数组中查找委托

我想在删除之前检查我的removeDelegate方法中是否已有委托.我怎么做?

这是我到目前为止所得到的:

protocol LocationManagerDelegate {
    func locationManagerDidUpdateLocation(
        oldLocation: CLLocationCoordinate2D,
        currentLocation: CLLocationCoordinate2D
    )
}

class LocationManager: NSObject {
    private var _delegates = [LocationManagerDelegate]()

    func removeDelegate(delegate:LocationManagerDelegate) {
        if contains(_delegates, delegate) {
            // Remove delegate
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,这会在'if contains'行中给出以下错误:

不能使用类型'(@lvalue Array <LocationManagerDelegate>!,LocationManagerDelegate)'的参数列表调用'contains'

delegates ios swift

5
推荐指数
1
解决办法
3071
查看次数