xcode6

XMPPFramework - How to register a new user account

我与影子孤独终老i 提交于 2019-12-10 20:32:21
问题 I'm trying to use XMPPFramework to connect to an Openfire server and create a new user account. If I am already logged in as a different user, this code will create a new user account: NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"jabber:iq:register"]; [query addChild:[NSXMLElement elementWithName:@"username" stringValue:userName]]; [query addChild:[NSXMLElement elementWithName:@"password" stringValue:pswd]]; NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"]; [iq

Implicit conversion of a non-Objective-C pointer type 'char *' to 'NSString *' is disallowed with ARC

ⅰ亾dé卋堺 提交于 2019-12-10 20:10:54
问题 For the following line of code I am getting the error below: for (UILabel *label in labels) { label.text = label.tag - 100 > someMutableString.length ? "" : "*"; } The error states: Implicit conversion of a non-Objective-C pointer type 'char *' to 'NSString *' is disallowed with ARC My variable "someMutableString" is of type NSMutableString. How do I fix in my particular case? 回答1: The problem is that your string literals are "" and "*" which are both C-style strings ( const char* ). So the

Making a text view respond to text typed by the user

穿精又带淫゛_ 提交于 2019-12-10 19:54:04
问题 I have a text view in my app which allows the user to type anything in it. I want the text view to detect a few words when they are typed and change their colour. For example , if the user types- "My favourite colour is red", then I want the word 'red' to get the text colour 'red'. But thus should happen immediately after the word red is typed in the sentence. How should I implement this? 回答1: You need three things : In the interface builder you need to use one of the delegate methods. I

Xcode 6 GM with iPhone 5s (iOS 8 GM) - 0xE8000070

爱⌒轻易说出口 提交于 2019-12-10 17:58:16
问题 I'm using Xcode 6 GM Seed (build 6A313) with iPhone 5s (Model A1530, iOS 8 build 12A365). I connect the iPhone via USB lightning cable. But in Xcode, it shows as: "iPhone 5s (unavailable)". Further investigation: I open Xcode menu > Window > Devices , it shows the following error: An error was encountered while enabling development on this device. Please try rebooting and reconnecting the device. (0xE8000070) I reboot and reconnect my iPhone 5s, the same error is shown. This device was used

Facebook and Google+ Sign-In

限于喜欢 提交于 2019-12-10 17:34:42
问题 I'm using both Google+ and Facebook in my app. My problem is that both of them require the OpenURL method in the appDelegate. For Facebook login: func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool { return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation) } For Google+ login: func application(application: UIApplication, openURL

cannot decode object of class (AMPathPopUpButton)'

…衆ロ難τιáo~ 提交于 2019-12-10 16:47:56
问题 I'm new to Swift and I'm using xCode 6 Beta 5 . My issue is I'm getting compiler error: "Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: ' * -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (AMPathPopUpButton)'" when adding AMPathPopUpButton to my application UI. Any one can help?? 2014-08-17 22:17:39.285 FileSize[6633:303] An uncaught exception was raised 2014-08-17 22:17:39.286 FileSize[6633:303] *** -[NSKeyedUnarchiver

Quickly view the type of a Swift variable in XCode

隐身守侯 提交于 2019-12-10 16:15:13
问题 Is there any shortcut that will allow me to quickly view the type of any variable in Swift in XCode? Alt-Click returns "No Quick Help". Type inference is awesome, but makes life hard without tools such as these... 回答1: Either use Alt-click to display the declaration of the variable which displays the type at the top right like so: Or use autocompletion to show you the type: 来源: https://stackoverflow.com/questions/26493199/quickly-view-the-type-of-a-swift-variable-in-xcode

Unavailable message in TestFlight Beta

Deadly 提交于 2019-12-10 15:29:56
问题 I am seeing "Unavailable" message in TestFLight Beta App in iOS8. Please find the attached screenshot, please tell me how to fix this issue. 回答1: I get this all the time. In iTunes Connect, remove yourself as a tester, save, add yourself back, save, then open the beta build through the new invitation email you receive. 回答2: Make sure that the same version (i.e 2.4.1) your'e testing was not approved to sale. When a version is approved for sale by Apple, it becomes unavailable for testing.

Swipe between multiple view controllers using UIPageViewController

六眼飞鱼酱① 提交于 2019-12-10 15:13:59
问题 My UIPageViewController not working at all. What I'm trying to do is switch 2 view controllers inside UIPageViewController. I already followed guideline here but fail. Using UIPageViewController with swift and multiple view controllers. First view controller appeared successful but when I tried swipe to second view controller it throw this error message. I already set all identifiers correctly. fatal error: unexpectedly found nil while unwrapping an Optional value It's cause from here func

SKAction sequence temporary delay (initial delay?)

老子叫甜甜 提交于 2019-12-10 14:07:29
问题 So in the game I'm building I want to repeat an action, but I want it to have an initial delay. So for example, the action would execute three seconds after the user started the game, but after it executes for the first time, there's no longer a three second delay. What can I do to solve this? Thanks in advance! 回答1: You could use an SKAction to make a delay, then put it at the beginning of your sequence . Apple gives some sample code on sequences: SKAction *moveUp = [SKAction moveByX:0 y:100