小编Fer*_*ndo的帖子

.gitignore for xcuserdata文件夹中的所有内容都不会忽略xcuserstate文件

我在Xcode项目中工作,我正在尝试配置.gitignore以获取xcuserdata文件夹中的任何内容.

我有以下.gitignore:

# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
xcuserdata/*
Run Code Online (Sandbox Code Playgroud)

但每次我构建/运行项目并执行时git status,它仍会显示以下中间文件:

modified: MyProject.xcodeproj/project.xcworkspace/xcuserdata/fernando.xcuserdatad/UserInterfaceState.xcuserstate
Run Code Online (Sandbox Code Playgroud)

有人知道什么是错的吗?

git xcode gitignore

30
推荐指数
4
解决办法
4万
查看次数

在UIImagePickerController中强制横向方向

我是iOS开发的新手,我正在开发我的第一个应用程序.(很抱歉,如果我问一个新手问题)

我的应用程序都是纵向的,除了我正在使用UIImagePickerController来拍照在应用程序中使用的地方,我正在做的是:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
picker.allowsEditing = NO;
[self presentModalViewController:picker animated:YES];
Run Code Online (Sandbox Code Playgroud)

由于我的应用程序是在Portrait中,我需要在UIImagePickerController中创建一些横向中.如果我尝试使用:

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
Run Code Online (Sandbox Code Playgroud)

似乎我无法使用,因为我的Xcode在这一行中识别为错误(可能是因为Xcode的版本,我不确定).而且我不确定,但似乎如果我正在为iOS 5.1开发我也需要为iOS 6.0实现一些东西,它是否正确?

有人可以帮助我理解制作这个UIImagePickerController需要什么,只有应用程序中的这个视图控制器,在横向工作,并在iOS 5.1和6中工作?

问候

xcode objective-c orientation uiimagepickercontroller ios

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

UITabBar和UITabBarItem,iPhone 5和iPhone 6的特定图片@ 2x

我正在开发一个新的应用程序,我正面临一些问题来定制UITabBar,并使用@ 2x图像在iPhone 5和6中使其工作(设计)很棒.

在AppDelegate.m中,在didFinishLaunchingWithOptions方法中,我为后台选择了图像,选择了项目:

//TABBAR
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2];
UITabBarItem *tabBarItem4 = [tabBar.items objectAtIndex:3];
UITabBarItem *tabBarItem5 = [tabBar.items objectAtIndex:4];

[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"tab_bg"]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"icone_home_selecionado"]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
Run Code Online (Sandbox Code Playgroud)

然后,在相同的方法中,对于每个项目,我设置图像和插图:

tabBarItem1.title = nil;
tabBarItem1.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);
[tabBarItem1 setImage:[[UIImage imageNamed:@"icone_home_teste"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

tabBarItem2.title = nil;
tabBarItem2.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);
[tabBarItem2 setImage:[[UIImage imageNamed:@"icone_home_teste"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

tabBarItem3.title …
Run Code Online (Sandbox Code Playgroud)

iphone uitabbaritem uitabbar ios

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