Tag: xcode

约束照顾不同的iPhone / iPad尺寸的图像xcode 7testing版4

我是iOS开发的新手,所以在Xcode中为故事板上的对象设置约束对我来说很困难。 如下图所示,我为草图中创build的button设置了3个边框,以便它们都是图像,每个图像都位于图像视图内部: 我试图通过将所有三个图像固定在左侧,右侧和下方来添加约束,但是我得到了错误,并且在模拟器上没有正确显示。 所有图像都处于方向填充模式,当我将图像放入故事板时,我可以看到iPhone 4的大小。 下面是在iPhone 6模拟器中看起来像没有任何约束的例子: 有什么限制,我需要这样,它看起来好所有的iPhone和iPad的大小,看起来像它在故事板? 景观模式不会成为这个应用程序的一部分,所以不需要考虑。

IOS:移回两个视图

我一直坚持这个问题一段时间,找不到任何有用的信息,如何做到这一点.. 我有一个基本视图(视图1),我可以在tableview中select项目。 在项目“页面”(视图2)时,我可以select编辑该项目,触发模态视图(视图3)。 在这个模式下,我可以select删除这个项目。 如果用户按下该button并确认他们想要删除该项目,我想发送应用程序回查看1 .. 我已经尝试了一些不同的东西( popToViewController , pushViewController , dismissViewController等),但我不能得到任何工作。 如果我得到模式closures,查看2不closures。 有时甚至模态也不会消失。 基本视图是一个UITableViewController ,另外两个是UIViewControllers ,而我正在使用storyboard 。

使用#define和clang为info.plist创build版本号变体?

几年前,在编译GCC时,在#include.h文件中定义的以下内容可以在info.plist中预处理: #define MAJORVERSION 2 #define MINORVERSION 6 #define MAINTVERSION 4 <key>CFBundleShortVersionString</key> <string>MAJORVERSION.MINORVERSION.MAINTVERSION</string> …将变成“2.6.4”。 这是因为海湾合作委员会支持“传统”的国旗。 (请参阅Xcode中的技术说明TN2175 Info.plist文件使用C预处理器 ,在“在macros扩展过程中消除令牌之间的空白”下) 但是,快进到2016和Clang 7.0.2(Xcode 7.2.1)显然不支持“-traditional”或“-traditional-cpp”(或正确支持),产生以下string: "2 . 6 . 4" (请参阅错误12035 – 预处理程序在macros扩展中插入空格,注释4 ) 因为有很多不同的变体(CFBundleShortVersionString,CFBundleVersion,CFBundleGetInfoString),所以最好解决这个叮当问题,并定义一次,然后连接/串联这些部分。 什么是现在这样做的普遍接受的模式? (我目前正在build立在MacOS上,但IOS的工作模式是一样的)

Appium,Instruments在启动时坠毁

当我将Xcode从6.4更新到7.2时,我的Appium UI Automation停止工作,仪器崩溃。 Appium:1.4.13 Xcode:7.2 这里是错误日志: info: Launching instruments info: [debug] Attempting to run app on iPhone 6 (8.4) info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 6 (8.4)" /var/folders/23/nmp6lms102vg0s25m1322t400000gp/T/116125-731-112rfi4/Time.app -e UIASCRIPT "/Users/bogdan.shubravyi/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7/InstrumentsShim.dylib","LIB_PATH":"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/thirdparty/iwd7"} info: [debug] And launch timeouts (in […]

在xcode 5中实例化ViewControllerWithIdentifier

我正在Xcode 5的故事板上工作。我有一个导航控制器,并试图build立到故事板中其他场景的转换。 我第一次尝试使用: – (IBAction)handleTap:(UITapGestureRecognizer *)sender { NSLog(@"Image clicked"); _detailPage = [[MPDetailPageViewController alloc] initWithNibName:@"MPDetailPageViewController" bundle:nil]; _detailPage.product = _curProduct; //Bring to detail page [self.navigationController pushViewController:self.detailPage animated:YES]; } 这会把我带到黑屏。 在stackoverflow上search我发现这个post从2013年2月build议使用instantiateViewControllerWithIdentifier 所以我试了一下: – (IBAction)handleTap:(UITapGestureRecognizer *)sender { NSLog(@"Image clicked"); _detailPage = [self.storyboard instantiateViewControllerWithIdentifier:@"MPDetailPageViewController"]; _detailPage.product = _curProduct; //Bring to detail page [self.navigationController pushViewController:self.detailPage animated:YES]; } 但是,这给了我一个错误 Storyboard()不包含标识符为“MPDetailPageViewController”的视图控制器 我试图找出如何find/设置标识符,并看到post引用Storyboard ID ,但是当我看我的屏幕上,我只看到Restoration […]

xCode:如何修复线程5:EXC_BREAKPOINT(code = 1,subcode = 0x10025c76c)

当我点击iPhone中的btnLogin时,xCode显示错误: 线程5:EXC_BREAKPOINT(代码= 1,子代码= 0x10025c76c) 这是我的代码 @IBOutlet weak var abc: UILabel! … @IBAction func btnLogin(sender: UIButton) { var jsonResult = AnyObject?() let urlAsString = "lifewinner2015.dlinkddns.com/SERVER/user?function=login&username=Shing&password=123456789" let url = NSURL(string: urlAsString) let urlSession = NSURLSession.sharedSession() let jsonQuery = urlSession.dataTaskWithURL(url!, completionHandler: {data, reponse, error -> Void in if (error != nil) { print("error") } do { jsonResult = […]

我如何实现禁用的应用程序设置?

我如何实现禁用的应用程序设置? 我在Nike Running应用程序中看到了这个function。 我search了很多这个function,但找不到一个可能的解决scheme。 在苹果网站和互联网上没有教程或没有参考。 有任何想法吗 ? 在此先感谢你们…

ld:找不到-l使用cocoapods的库

每个人 我遇到的问题是我无法编译我的应用程序,因为我得到以下错误: ld: library not found for -lBolts clang: error: linker command failed with exit code 1 (use -v to see invocation) 我有我的XCode项目configuration使用cocoapods,这是我的豆荚列表: pod 'Google/Analytics', '~> 1.0.0' pod 'AFNetworking', '~> 2.0' pod 'XCDYouTubeKit', '~> 2.4.0' pod 'FBSDKCoreKit' pod 'FBSDKShareKit' pod 'FBSDKLoginKit' pod 'Parse' pod 'ParseUI' pod 'ParseFacebookUtilsV4' pod 'ParseTwitterUtils' 这是命令pod install的输出: Updating local specs repositories […]

升级到iOS 9和MobileFirst 7.1后无法在设备或模拟器上login应用程序

使用Ionic和IBM MobileFirst构build的混合应用程序在通过XCode构build并部署到设备或通过iOS模拟器升级到iOS 9和MF 7.1后无法login。 我正在Eclipse中的本地WebSphere Liberty服务器上运行此操作,因此不涉及SSH,因此遵循了从下面的链接中禁用位代码和ATS的说明,而没有任何效果。 https://developer.ibm.com/mobilefirstplatform/2015/09/09/ats-and-bitcode-in-ios9/ 然而,该应用程序能够使用MF Mobile Browser Simulatorlogin,只有在设备或iOS模拟器上尝试login时才会失败,所以我确定这是与构build过程而不是应用程序错误。 这是我得到的日志跟踪,似乎没有find服务器IP(我已经模糊),但是这是我的本地Liberty服务器的正确的IP 其他人有类似的问题? 任何帮助将非常感激! 2015-10-20 14:01:02.269 WorkManagement[26452:2390658] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/Eugene/Library/Developer/CoreSimulator/Devices/49A9535D-0085-4FD6-A57F-A45D0F7E7819/data/Containers/Data/Application/86E6CEFF-F2E5-4523-9763-A421A1A64659/Library/Cookies/com.WorkManagement.binarycookies 2015-10-20 14:01:02.427 WorkManagement[26452:2390658] [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667h 2015-10-20 14:01:02.453 WorkManagement[26452:2390658] [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: […]

如何使用Facebook iOS SDKpipe理生产和开发凭证

症状 我的应用程序使用Facebook来让用户login。它在从XCode进行debugging和通过AdHoc部署进行testing时工作正常,为了让外部testing人员提交我们的应用程序供审阅,但似乎Facebook在OAuth进程中抱怨“应用程序不是安装程序:这个应用程序的开发人员还没有正确设置这个应用程序的Facebooklogin“。 假设 XCode中的目标info部分中的Custom iOS target properties中的FacebookDisplayName和FacebookAppId与Facebook应用程序开发版本相匹配。 不知何故,SDK必须检测到,在审查过程中,应用程序不再在开发中,并发生错误。 题 如何在这个目标中Custom iOS target properties一些具有不同release和debug值的Custom iOS target properties ?