我尝试将我们App的iOS-10更新上传到iTunes Connect.我正在使用Xcode 8 GM.
不幸的是,上传后,iTunes Connect会发送包含以下内容的邮件:
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据.应用程序的Info.plist必须包含一个NSPhotoLibraryUsageDescription键,其中包含一个字符串值,向用户解释应用程序如何使用此数据.
我们支持englisch,德语是西班牙语,因此在应用程序的文件夹中,有一个de.lproj,en.lproj和es.lproj文件夹,每个文件夹都包含一个InfoPlist.strings,它包含给定的键:
"NSPhotoLibraryUsageDescription" = "my description…";
Run Code Online (Sandbox Code Playgroud)
任何想法,出了什么问题以及如何检查这个?InfoPlist.strings在正确的构建目标中具有目标成员资格,甚至在我们的app-extension的构建目标中也是如此.
我们有一个使用两个导航层次结构的模块化应用程序,因此有两个堆叠的导航栏…有时,在拖动refreshcontrol时,导航栏会保持很大,并且在刷新完成后不会恢复到正常大小。我只能猜测,在这种情况下它会回退,而在某种情况下它不会……视觉调试器显示,使用此空间的视图是_UINavigationBarLargeTitleView。在中viewDidLoad,将self.navigationController.navigationBar.prefersLargeTitles设置为NO。
viewDidLoad通过以下方式添加RefreshControl :
self.refreshControl = [RefreshControl new];
Run Code Online (Sandbox Code Playgroud)
我已经尝试过的一些东西:
contentOffset为(0,-1)。YES,然后设置为NO。largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
有谁知道会导致这个问题的原因吗?就像我说的,我什至不知道什么时候发生这种情况,什么时候不发生……
将我们的代码应用于 iOS 11,我正在努力解决 UINavigationController 中定位的 UISearchbar。我像这样设置 SearchController/SearchBar:
self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
self.searchController.searchBar.scopeButtonTitles = @[@"foo", @"bar"];
self.searchController.searchBar.showsScopeBar = YES;
self.searchController.searchResultsUpdater = self;
self.searchController.searchBar.delegate = self;
self.searchController.delegate = self;
self.searchController.dimsBackgroundDuringPresentation = NO;
self.searchController.hidesNavigationBarDuringPresentation = NO;
self.definesPresentationContext = YES;
if (@available(iOS 11.0, *))
{
self.navigationItem.searchController = self.searchController;
self.navigationItem.hidesSearchBarWhenScrolling = YES;
UISearchBar *searchbar = self.searchController.searchBar;
[searchbar setSomeColors];
}
Run Code Online (Sandbox Code Playgroud)
当使用我们的默认颜色时,事情可能看起来不错,但 SearchBar 和 ScopeButtons 之间的空间可能有点太大:
更改搜索栏的 backgroundColor 揭示出了什么问题:

因此,UISearchBar 在其父视图中的位置有点太高了。有谁知道,是什么导致了 iOS 11 中的这种行为?
在我们的代码中的某个时刻,我们想知道某些值的系统数据类型.所以我们在传入时进行检查,例如其中一个NSNumber:
if (strcmp([numberObject objCType], @encode(NSInteger)) == 0)
{ /* tag as integer */ }
Run Code Online (Sandbox Code Playgroud)
在64位模拟器上执行此操作,将BOOL放入NSNumber会产生奇怪的结果.
NSNumber *foo = [NSNumber numberWithBool:YES];
if(strcmp([foo objCType], @encode(BOOL)) == 0))
{ /* this should work, but it does not on 64bit */ }
Run Code Online (Sandbox Code Playgroud)
作为后备,我们可以使用类似的东西
if(strcmp([foo objCType], [[NSNumber numberWithBool:YES] objcType]) == 0))
{ /* this works, but looks like too much work for the processor */ }
Run Code Online (Sandbox Code Playgroud)
编译32位模拟器,它工作得很好.(在这两种情况下,BOOL看起来都像'char'类型,但是比较并没有给出64位的预期结果).
那么,有没有人有任何想法,为什么@encode(BOOL)在初始化时与[foo objCType]不匹配numberWithBool:?
我有一个ViewController,它将在init上请求访问位置服务
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined)
{
[_locationManager requestWhenInUseAuthorization];
}
Run Code Online (Sandbox Code Playgroud)
这会触发"允许应用在您使用应用时访问您的位置?" - 提醒.
我[self addUIInterruptionMonitorWithDescription:handler:]用来对此做出反应.我遇到以下问题:在解除请求对话框后,ui-test不会继续.该警报被驳回,但Xcode中等待应用程序成为空闲,但它看起来像应用程序是空闲的:
t = 67.35s Wait for app to idle
Run Code Online (Sandbox Code Playgroud)
测试失败,因为应用程序卡在这里.如果我点击模拟器,Xcode记录.
t = 72.27s Synthesize event
Run Code Online (Sandbox Code Playgroud)
并继续测试.
有没有理由,为什么Xcode试图等待应用程序?解决方法似乎是告诉Xcode UI已更改或事件发生.有没有办法触发这个?