xcode7

SWIFT: how to run a function even when user kills the app

落爺英雄遲暮 提交于 2019-12-12 19:16:44
问题 I am using swift 2 and Xcode7 for iOS9. I want to know if I can maintain a function (that checks for something to delete) running "forever" even if the user kills the app? I am deleting contacts from the contact list according to some rules and time. It is running ok, but just with the app opened or in second plan. I want to make this app capable to delete those contacts even when the user kills it. 回答1: You can use background thread when user opens the app. But if the app will be terminated,

Running Bash Script on XCode Compile — Where To Get List of Build Variables?

瘦欲@ 提交于 2019-12-12 17:03:46
问题 When using XCode to compile a Cocoa application, I'm running a custom Bash script in the build phase. Unfortunately, I'm having to spell out full paths. Instead, I'm almost certain there are variables I can use in the Bash and one of those might cover it. Here's what I'm running: /Users/mike/Projects/objectivec/proj1/proj1/shellscript.sh /Users/mike/Projects/objectivec/proj1/proj1/proj1/lang/en/html/ See how having a $VAR would help here, rather than specifying physical paths? It would also

Swift: Use of undeclared type

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 14:20:02
问题 I'm implementing a class but I'm getting this error: Use of undeclared type 'myProtocol' Here is my code: class LocalContactService: myProtocol{ Any of you knows why I'm getting this error? 回答1: i had the same error .in my case i found accidentally that i added my swift files into "copy bundle resource" in "build phase" i removed all swift file except assets then everything worked fine. 回答2: Perhaps you've never defined myProtocol . Or if you have, maybe it's out of scope in the

added custom key to info.plist, when I access from playground in Swift, it is nil

淺唱寂寞╮ 提交于 2019-12-12 14:15:13
问题 Using Xcode 7.2 (on Yosemite), I can't seem to access custom key from my info.plist from a playground: import UIKit var str = "Hello, playground" let app_id = NSBundle.mainBundle().infoDictionary?["MyAppID"] as? String Using the above code, app_id is nil. I expected it to be the String "TEST" I included it in my info.plist like this: Is there some limitation to playgrounds that I haven't read about? If I print all of the keys, my custom key is missing: let dict = NSBundle.mainBundle()

App frozen by UIKit after upgrading to Xcode 7

扶醉桌前 提交于 2019-12-12 13:15:23
问题 After upgrading my project to Swift 2.0 and using Xcode 7 (GM) I noticed some of my view controllers freeze the app on navigation. Instruments show me that CPU usage is over 9000% and is used by UIKit and Foundation. Have you encountered this problem? 回答1: It seems to be one of those Interface Builder issues. I've successfully defeated this by removing any text from UITextView in storyboard. And it comes again if I set text property back. Hopefully, this will help someone to not waste

Xcode 7 found a place where it prints a line with a log error

吃可爱长大的小学妹 提交于 2019-12-12 12:51:02
问题 I have a log in XCode output console: Use -removeDeferredKeyObserver: instead of -removeKeyObserver: I've searched trough the project using keyword removeKeyObserver but have not found any matches. My question is how to found a place (line) after Xcode prints this line in console. 回答1: As it can comes from a library or inside core frameworks, you should : Open terminal use grep "removeKeyObserver:" * -r to find where the method is called It used this method today for about the same purpose.

error code when using GIDSignIn.sharedInstance.clientID =

北战南征 提交于 2019-12-12 12:26:55
问题 I have an app which I used to use Auth2 to sign in using a client Id and client secret but now I have to use Google Sign In I have followed the instructions as I understand them but when I build I get this error -[__NSDictionaryI gtm_httpArgumentsString]: unrecognized selector sent to instance 0x17d49a40 I have added the framework I have imported the headers I have made a separate GoogleServices-info.plist with CLIENT_ID and REVERSED_CLIENT_ID I have put the following code in my ViewDidLoad

My xcode is showing two branches open at same time in source control

半世苍凉 提交于 2019-12-12 11:39:45
问题 My xcode is showing two branches open at same time in source control. i want to remove one brance from that. because it was producing some uncommited changes when i switch branch. Screenshot is attached. Thanks for your help in advance. Additional details Xcoed Version : 7.1 回答1: I had the same issue and found out how to remove the undesired branch under this environment : XCODE 7.3 (7D175) and use of CocoaPods generating '.xcworkspace' file. Following the steps hereafter is the way to find

onesignal/onesignal.h file not found

本小妞迷上赌 提交于 2019-12-12 11:07:33
问题 Xcode version 7.3.1 and i have developer apple id hi , i have strange problem to work and debug my project The Error says : onesignal/onesignal.h file not found i install and update pod without any error or problem through Console , i attach some screenshot that show error better image1 image2 where is the problem ? why i have not onesignal.h file after install it , and how can i fix this ? please help me i stuck in this for a few weeks 回答1: Try to update to onesignal 2.0 with the command pod

The user credentials are need to obtain access token. Please call the non-silent acquireTokenWithResource methods. ADALiOS issue

╄→гoц情女王★ 提交于 2019-12-12 10:23:24
问题 In my swift project, I am using convergence dev branch source code. I have added ADALiOS files manually in my project. Currently retrieving access token from refresh token is a problem. Till last week my project was working all fine but as I opened my project on Mondat i.e. 20th March, 2016, I don't know how and why my app is not able to save access token in local cache. So whenever I tried to get access token silently it is unable to retrieve it from local cache. For every call I am getting