确认!我最终在iOS 5中解决了我的tabbar旋转问题,但是iOS 6和xcode似乎已经破坏了......这就是我所拥有的:
目标应用程序摘要包括:支持的界面方向 - Portraint,Landscape Left,Landscape Right
应用程序中的每个单一视图都有以下方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return ((interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown) &&
(interfaceOrientation != UIInterfaceOrientationLandscapeLeft) &&
(interfaceOrientation != UIInterfaceOrientationLandscapeRight));
} else {
return YES;
}
}
- (BOOL)shouldAutorotate
{
NSLog(@"am I called1?");
return NO;
}
-(NSUInteger)supportedInterfaceOrientations{
NSLog(@"am I called?");
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)
在不属于选项卡栏的视图中,旋转被阻止.在标签栏的所有视图中(有5个),应用程序从不调用ShouldAutorotate,因此旋转.它确实看起来supportInterfaceOrientations在视图加载时被调用一次,但是当我在视图之间切换时它不会被调用,因为我得到了NSLog,但似乎忽略了MaskPortrait设置.
我必须在目标中启用横向,因为我有一个需要旋转的视频播放器视图(它确实如此,很好)
这是iOS 6中的tabbar错误吗?我是否需要以不同方式禁用视图的旋转?在ios 5中,shouldautorotatetointerfaceorientation运行良好
我已经有一段时间了
谢谢,扎克
希望这很简单,但我还没能找到修复方法.我有一个应用程序,我正在尝试实现iCloud和Core Data.我希望它可以在iOS7和iOS8上运行.
该应用程序是收藏品的清单/ tableview应用程序.
从本质上讲,该应用程序有一个预先播种的xml文件,其中包含大约50,000个文件.sqlite/core数据最初配置为只有1个项目.用户可以从表视图中选择要添加到核心数据存储的组(以便不包括所有50,000个项目).当用户选择具有1-50个项目的组时,它会解析这些项目的xml并将它们写入核心数据存储.当用户选择具有较大文件数量的组时,它会解析并添加它们,但在解析过程中也会抛出一些随机的"无文档处于url"错误.应用程序不会崩溃,并且似乎添加了所有项目,但应用程序停止与iCloud同步.确切的错误是:
__45-[PFUbiquityFilePresenter processPendingURLs]_block_invoke(439): CoreData: Ubiquity:
Librarian returned a serious error for starting downloads Error Domain=BRCloudDocsErrorDomain Code=5
"The operation couldn’t be completed. (BRCloudDocsErrorDomain error 5 - No document at URL)"
UserInfo=0x7fd7f54abea0 {NSDescription=No document at URL,
NSFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848- 0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt,
NSUnderlyingError=0x7fd7f54aa200 "The operation couldn’t be completed. No such file or directory"}
with userInfo {
NSDescription = "No document at URL";
NSFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed.
No such file or directory\" …Run Code Online (Sandbox Code Playgroud) 我有一个时代的狄更斯让整个Core Data,Storyboard,UISearchBar三人组合在一起工作.最后用Core Data成功构建了表,用搜索文本缩小了项目,并修改了prepareForSegue,还有一个打嗝......
当我点击表格中的任何项目进入详细视图时,未经过滤的表格中的一切都很好.调用PrepareForSegue并完美显示细节.
当我搜索时,我的表被过滤了(我现在要过滤数组选项而不是第二个NSFetchedResultsController,但不是因为没有尝试!).
当我单击筛选列表中的某个项目时,将调用prepareForSegue并按下详细信息视图,但是,它始终从列表中的第一个项目中提取详细信息!
例如,如果我搜索"c"并且列表缩小为"查理"和"Cookie",当我选择"查理"时,我会看到"查理"的详细视图.当我选择"Cookie"时,不幸的是,我也看到了"查理"的详细视图
我假设prepareForSegue代码是问题(可能不正确?).这是代码:
SampleTVC *sampleDetailTVC = segue.destinationViewController;
sampleDetailTVC.delegate = self;
// Store selected Role in selectedRole property
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
// self.selectedRole = [self.fetchedResultsController objectAtIndexPath:indexPath];
if (savedSearchTerm){
self.selectedRole = [self.searchResults objectAtIndex:indexPath.row];
} else {
self.selectedRole = [self.fetchedResultsController objectAtIndexPath:indexPath];
}
NSLog(@"Passing selected role (%@) to SampleTVC", self.selectedRole.name);
sampleDetailTVC.role = self.selectedRole;
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激!
core-data ×1
icloud ×1
ios6 ×1
ios8 ×1
objective-c ×1
rotation ×1
uisearchbar ×1
uitableview ×1