小编Tap*_*ani的帖子

Xcode 8 beta:可测试的名称必须是唯一的

我安装了Xcode 8 beta 3并尝试将源文件转换为Swift 3.不起作用,因为我每次都会收到以下错误:

可测试的名称必须是唯一的

知道这意味着什么吗?

xcode swift

12
推荐指数
1
解决办法
1005
查看次数

ESLint 找不到 React Native 组件

我在所有导入 React Native 组件的 js 文件中都收到了这些 ESLint 错误。从所有其他库导入工作正常,应用程序也可以编译和运行,没有问题。知道可能是什么原因吗?

  3:3  error  Text not found in 'react-native'        import/named
  4:3  error  View not found in 'react-native'        import/named
  5:3  error  ScrollView not found in 'react-native'  import/named
  6:3  error  StyleSheet not found in 'react-native'  import/named
Run Code Online (Sandbox Code Playgroud)

进口:

import {
  Text,
  View,
  ScrollView,
  StyleSheet 
} from 'react-native';
Run Code Online (Sandbox Code Playgroud)

包.json

"react-native": "0.62.0",
"eslint": "6.8.0",
"eslint-plugin-react-native": "3.8.1",
"@react-native-community/eslint-config": "1.0.0",
"flow-bin": "0.121.0" (not using in my code)
Run Code Online (Sandbox Code Playgroud)

.eslintrc:

{
  "env": {
    "es6": true,
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": 7,
    "sourceType": …
Run Code Online (Sandbox Code Playgroud)

javascript eslint react-native

11
推荐指数
1
解决办法
1576
查看次数

限制领域结果

如何限制Realm返回的对象数量?.findAll返回与查询匹配的所有行,而.findFirst仅返回第一行.但是像1000年前的那样呢?.findAll可能会返回如此多的行,以至于它消耗的内存过多.

android realm

10
推荐指数
1
解决办法
6513
查看次数

我应该在领域使用@Index吗?

我有最大值 我的数据库中有600000个Realm对象.我通过id(int)=,uuid =和time(int)<=进行查询,结果按时间排序.我是否应该对某些字段使用@Index注释,并可能将ID从Integer更改为String?查询是否会变慢,因为我无法索引时间字段并且不能有多字段索引?Sqlite能更好地满足我的需求吗?

另外,如果我一次将大量对象存储到数据库中,我应该为所有对象使用一个事务还是为每个对象创建一个新事务?大型事务占用多少内存,并且在为每个对象创建新事务时是否存在性能损失?

数据库将位于Android设备的外部存储(存储卡)中.

android realm

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

自iOS 9以来,VectorKit/OpenGL在MKMapView中崩溃

我可以从Crashlytics看到我的一些应用程序用户遇到以下崩溃.我自己从未见过这些,也不知道如何重现它们,因为它们在堆栈跟踪中没有我的代码.我已经读过OpenGL,当应用程序在后台时尝试更新表面时,可能会发生一些崩溃.不确定这是否是这种情况,因为在iOS 9之前没有发生崩溃.

我在地图上有几个注释,自定义MKAnnotationView派生视图,一些自定义叠加和MKTileOverlay派生的tile源.地图处理代码和叠加层是Objective-C,但我的应用程序也有一些Swift代码.

有没有人有任何想法可能是崩溃的原因?

1)

Thread : Crashed: com.apple.maps.geogl.renderQueue
0  VectorKit                      0x18c82a894 ___ZN3ggl10GLRenderer5frameEPNS_12RenderTargetEPNS_11RenderQueueE_block_invoke_2 + 876
1  VectorKit                      0x18c82a47c ___ZN3ggl10GLRenderer5frameEPNS_12RenderTargetEPNS_11RenderQueueE_block_invoke + 212
2  libdispatch.dylib              0x182625630 _dispatch_call_block_and_release + 24
3  libdispatch.dylib              0x1826255f0 _dispatch_client_callout + 16
4  libdispatch.dylib              0x182631634 _dispatch_queue_drain + 864
Run Code Online (Sandbox Code Playgroud)

2)

Thread : Crashed: com.apple.mapdisplay.stylesheetLoadQueue
0  libdispatch.dylib              0x183ec2a90 dispatch_async + 76
1  libdispatch.dylib              0x183ec2a88 dispatch_async + 68
2  VectorKit                      0x18df501c4 std::__1::__function::__func<-[VKTileSetBackedTileSource setStyleManager:]::$_0, std::__1::allocator<-[VKTileSetBackedTileSource setStyleManager:]::$_0>, void (std::__1::shared_ptr<gss::StyleManager>, bool)>::operator()(std::__1::shared_ptr<gss::StyleManager>&&, bool&&) + 176
3  VectorKit                      0x18e11533c std::__1::__function::__func<gss::StyleManager::addFinishedDecodingGlobalPropertiesCallback(std::__1::function<void (std::__1::shared_ptr<gss::StyleManager>, bool)>)::$_0, std::__1::allocator<gss::StyleManager::addFinishedDecodingGlobalPropertiesCallback(std::__1::function<void (std::__1::shared_ptr<gss::StyleManager>, bool)>)::$_0>, void (bool)>::operator()(bool&&) …
Run Code Online (Sandbox Code Playgroud)

opengl-es objective-c mapkit ios

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

嵌套闭包是否会导致保留周期?

weak self当只有外部引用时,我是否需要在内部闭合中使用self?外壳是否self仅在内盖中使用时才会被捕获?

self.myClosure = {
    // First do something in the background without self...

    // Then do something in the main thread with self...
    dispatch_async(dispatch_get_main_queue()) { 

        [weak self] in // IS THIS REALLY NEEDED?

        self?.underlyingImage = img
        self?.imageLoadingComplete()
    }
}
Run Code Online (Sandbox Code Playgroud)

ios swift

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