小编Lew*_*s42的帖子

为什么我的Flot y轴标签出现在轴上?JQM

我一直在努力建立一个使用JQuery Mobile和Flot的网站.这个想法是它可以显示您可以在其间滑动的图形.

到目前为止,我有这个:http://lasmit.co.uk/tmm-graphs/graph2.php

第一个图表工作正常,但如果您向侧面滑动,标签会出现在轴线上并向外看.

我确信我在这里遗漏了一些明显的东西,所以任何帮助都会非常感激.

javascript flot jquery-mobile

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

iCloud核心数据在Xcode 6/ios 8 SDK中运行后不可用

我有一个使用Core Data和iCloud同步的应用程序.它在iOS 7中运行良好.

我在XCode 6中运行它有一些麻烦,即使在iOS 7设备上也是如此.这是我的测试:

  • 在iOS 7设备上:从应用商店下载当前的实时应用
  • 从iCloud同步数据
  • 构建并运行新版本的应用程序
  • 持久存储发生变化,原始数据不再可用

这是我的配置文件和xcode设置的屏幕截图:

在此输入图像描述

我还尝试了以下权利:

  1. 只是 com.apple.developer.icloud-container-identifiers
  2. com.apple.developer.ubiquity-container-identifiers这就是我之前所拥有的.当我运行测试时,数据是第一次但不是第二次运行.没有关于商店变化的事件,但它Using local storage: 1在第一次和第二次运行时说
  3. 以上都是.获得与#2相同的结果

core-data icloud

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

访问存储在[NSFileManager containerURLForSecurityApplicationGroupIdentifier]中的文件以进行调试

我有一个具有以下代码的应用程序:

NSURL *containerURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"group.com.myCo.myApp"];
[containerURL URLByAppendingPathComponent:@"Myfile"]];
Run Code Online (Sandbox Code Playgroud)

读取和写入仍在Myfile工作,但我希望能够直接在手机上访问该文件以进行调试和测试。

它不在App的容器中(“窗口”>“设备” >>“下载”容器),将设备连接到计算机的开发人员真的不能访问它吗?我觉得我在这里想念什么吗?

objective-c nsfilemanager ios8 ios8-extension

5
推荐指数
0
解决办法
242
查看次数

iOS导航栏更喜欢大标题滚动行为

在iOS 11中,如果启用prefersLargeTitles,系统应用程序会在向下滚动时压缩导航栏:

在此输入图像描述

我无法弄清楚如何在我自己的应用程序中实现这一点,默认情况下栏保持不变:

在此输入图像描述

我唯一能看到的就是Hide Bars On Swipe,但它会隐藏整个条而不是压缩它:

在此输入图像描述

这只是一个在Xcode 9 beta中创建的空项目,并添加了新的故事板.

为了获得与系统应用程序相同的行为,我需要做什么?

cocoa-touch uinavigationbar uikit uinavigationcontroller ios11

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

检测/接收 CloudKit CoreData 错误

在开发过程中,我已经转向NSPersistentCloudKitContainer并开始了尝试测试尽可能多的场景以确保没有人丢失任何数据的可怕过程。

在一些测试中我看到了这样的错误:

<CKError 0x28033a310: "Partial Failure" (2/1011); "Failed to modify some records"; uuid = B6015357-50E0-40B3-949F-1557F59A23DB; container ID = "iCloud.com.xxxx.yyyyyy"; partial errors: {
    F023EFDF-B9DE-4C17-872B-01C34C0DF129:(com.apple.coredata.cloudkit.zone:__defaultOwner__) = <CKError 0x280266fa0: "Invalid Arguments" (12/2006); server message = "Cannot create or modify field 'CD_someField' in record 'CD_someRecord' in production schema"; uuid = B6015357-50E0-40B3-949F-1557F59A23DB>
    ... 399 "Batch Request Failed" CKError's omited ...
}>
Run Code Online (Sandbox Code Playgroud)

我能够修复这个问题,但它只会影响某些场景,如果这种情况发生在真正的用户身上,他们(和我)将永远不会知道这个问题,并且他们的数据也不会同步到 CloudKit。

如果商店无法加载,您会收到一个错误,但如果它加载但不同步,则不会。

所以我的问题是:有没有办法接收代码中的此类错误?

我寻找了通知和委托方法,但找不到。

core-data cloudkit nspersistentcloudkitcontainer

5
推荐指数
0
解决办法
109
查看次数

从 CloudKit + CoreData 触发多个重复的 NSPersistentStoreRemoteChange 通知

我发现.NSPersistentStoreRemoteChange通知被多次收到,有时多达 10 次。

\n

认为这没有害处,但最好的情况是它会耗尽处理能力。

\n

所以我的问题是:

\n
    \n
  • 这有害吗?
  • \n
  • 我可以阻止它吗?
  • \n
  • 如果没有,是否有推荐的方法来忽略重复的通知?
  • \n
\n

--

\n

我有以下代码来设置我的容器。它包含在单例的初始化程序中,我已经确认它被调用一次。

\n
guard let modelURL = Bundle(for: type(of: self)).url(forResource: momdName, withExtension:"momd"),\n            let mom = NSManagedObjectModel(contentsOf: modelURL)\n            else {\n                fatalError(" Error loading model from bundle")\n        }\n        \n        let containerURL = folderToStoreDatabaseIn.appendingPathComponent("Model.sqlite")\n      \n            container = NSPersistentCloudKitContainer(name: momdName, managedObjectModel: mom)\n            \n            guard let description = container.persistentStoreDescriptions.first else {\n                fatalError(" ###\\(#function): Failed to retrieve a persistent store description.")\n            }\n            \n            description.url = …
Run Code Online (Sandbox Code Playgroud)

core-data cloudkit nspersistentcloudkitcontainer

5
推荐指数
0
解决办法
355
查看次数

当不在小部件中时如何设置 .widgetFamily @Environment 变量?

我想在我的主应用程序中预览我的 WidgetKit 小部件。

小部件的布局.systemSmall.systemMedium大小不同。

当我.environment(\.widgetFamily, .systemSmall)在主应用程序中设置时,出现构建错误:

Key path value type 'WritableKeyPath<EnvironmentValues, WidgetFamily>' cannot be converted to contextual type 'KeyPath<EnvironmentValues, WidgetFamily>'
Run Code Online (Sandbox Code Playgroud)

如果我不设置值,则默认为.systemMedium.

有办法使用吗.systemSmall

widgetkit swiftui

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

Weather API + WidgetKit - “在不支持并发的函数中调用‘异步’”

TimelineProvider我正在尝试为 iOS 16制作一个WeatherKit,但我正在努力解决如何满足协议签名并使用新的异步 api 的问题。

这是我的代码:

struct WeatherProvider: TimelineProvider {
    
    func getSnapshot(in context: Context, completion: @escaping (WeatherEntry) -> ()) {       
        let weather = try? await WeatherService.shared.weather(for: currentLocation)        
        let entry = WeatherEntry(date: Date(), wind: nil, locationAuthStatus: nil)

        completion(entry)
    }

    // etc
}
Run Code Online (Sandbox Code Playgroud)

编译此命令会引发构建错误'async' call in a function that does not support concurrency

自动修复建议:Add 'async' to function 'getSnapshot(in:completion:)' to make it asynchronous

但如果你这样做,结构就不再符合:Type 'WeatherProvider' does not conform to protocol 'TimelineProvider'

这感觉应该是微不足道的,但我找不到任何关于如何做到这一点的例子。

async-await swift widgetkit weatherkit

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

隐私 - 位置默认精度降低 (NSLocationDefaultAccuracyReduced) 不受尊重

Privacy - Location Default Accuracy Reduced在应用程序文件中进行设置Info.plist然后调用locationManager.requestWhenInUseAuthorization()仍然需要用户的精确位置许可。

core-location

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

CAGradientLayer显示完全半透明

我正在尝试创建两个渐变层,一个在滚动视图的每一侧,以便显示有要滚动的内容.

左侧的那个工作正常,但右侧的一个显示完全透明.我错过了什么?

厦门国际银行

揭示

CAGradientLayer *l = [CAGradientLayer layer];
l.frame = self.leftBlur.frame;
l.colors = [NSArray arrayWithObjects:(id)[UIColor whiteColor].CGColor, (id)[UIColor clearColor].CGColor, nil];
l.startPoint = CGPointMake(0.0f, 0.5f);
l.endPoint = CGPointMake(1.0f, 0.5f);
self.leftBlur.layer.mask = l;

self.leftBlur.hidden = YES;

CAGradientLayer *r = [CAGradientLayer layer];
r.frame = self.rightBlur.frame;
r.colors = [NSArray arrayWithObjects:(id)[UIColor clearColor].CGColor, (id)[UIColor whiteColor].CGColor, nil];
r.startPoint = CGPointMake(0.0f, 0.5f);
r.endPoint = CGPointMake(1.0f, 0.5f);
self.rightBlur.layer.mask = r;
Run Code Online (Sandbox Code Playgroud)

调试输出:

(lldb) po r
<CAGradientLayer:0x170ba6d0; position = CGPoint (305 62.5); bounds = CGRect (0 0; 30 125); allowsGroupOpacity = YES; endPoint …
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c calayer ios

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

ibtool无法构建 - 无法打开文件"Info.plist",因为没有这样的文件

在Xcode 7 beta 5中构建项目时出现以下错误:

Summary:
My project won't build, the following error is given:
LinkStoryboards
    cd /Users/lewis/Projects/MyApp/code/ios9
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode-beta.app/Contents/Developer/usr/bin/..
    /Applications/Xcode-beta.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module MyApp --target-device iphone --minimum-deployment-target 8.0 --output-format human-readable-text --link /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Products/Debug-iphonesimulator/MyApp.app /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Storyboard\ ios7.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Settings.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/TrackIt.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/UserList.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Migration.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Intro.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/YourMyApp.storyboardc /Users/lewis/Library/Developer/Xcode/DerivedData/MyApp-awistawhhrjdspbponhiluccszrg/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/AddMeasurements.storyboardc


/* com.apple.ibtool.errors */
: error: The file “Info.plist” couldn’t be opened because there is no such file.
    Failure Reason: The file doesn’t exist.
    Underlying Errors:
        Description: The operation couldn’t be completed. No such file or directory …
Run Code Online (Sandbox Code Playgroud)

xcode interface-builder uistoryboard

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