FAQ Database Discussion Community


Error after update to Swift 1.2

ios,xcode,swift,ios8,xcode6.3.2
I updated shortly to Swift 1.2 which comes with Xcode 6.3.2 and wrote a few lines of code: let originView:UIView! override init() { super.init() } init(sourceView:UIView, menuItems:Array<String>){ super.init() originView = sourceView } This code runs perfect till I updated the new version of Xcode (6.3.2). Now I get the following...

iOS Text in label is hidden vertically

ios,xcode
I really don't know what is causing this, I added a label and when it is showing on the iPhone, it appears like this: I'm really clueless on that one......

UIWebView path depends on previous pressed button Xcode

ios,objective-c,iphone,xcode,uiviewcontroller
I have a ViewController (A), containing n buttons. all buttons map to other ViewController(B) containing a WebView to show a different PDF. Instead of creating n ViewController, I would know how to change path according to which button was pressed. my wrong tries: 1- use tags of buttons in ClassB...

WatchKit Invalid Bundle Structure- WatchKitStub

ios,xcode,watchkit
Just wanted to share this answer. While submitting to the App Store I got an error saying the Bundle Structure including WatchKitStub was invalid.

Is it possible to have XCode completion in new Swift file edition (not in a project)?

xcode,swift
Now that I found out that you can actually execute a swift program in command line by calling swift myScript.swift I was thinking about writing a few programs that I usually write in Python with Swift. Although I can do that in another editor without trouble, I grew used to...

Objective C - bold and change string text size for drawing text onto pdf

objective-c,xcode,pdf,size,bold
I've created a .xib file with a uiview solely for the pdf document that I have created. I've primarily followed this tutorial for code: http://www.raywenderlich.com/6818/how-to-create-a-pdf-with-quartz-2d-in-ios-5-tutorial-part-2 From the above, I can't edit labels (plain or attributed) from the interface builder as even after changing size, it doesn't apply when the app...

I only encrypt saved game data in plist using AES256. Do I have to check US Export?

ios,xcode,app-store
I use RNEncryptor to encrypt the saved data of the game in .plist using AES256 Do I have to check yes to Export Compliance?? because I am having difficulties in obtaining the CIN...

New warnings in iOS9

xcode,ios9
I have this new warning about the Google Framework in my app: (null): URGENT: all bitcode will be dropped because '/Users/myname/Library/Mobile Documents/com~apple~CloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note:...

Objective c - ios : How to pick video from Camera Roll?

ios,objective-c,iphone,xcode,uiimagepickercontroller
I try this : UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext; videoPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4]; videoPicker.videoQuality = UIImagePickerControllerQualityTypeHigh; [self presentViewController:videoPicker animated:YES...

What is the best way to make sure I am not using any unavailable API's on OSX?

objective-c,xcode,osx,cocoa
I am writing an OSX app in Xcode 6 but want my application to have support for OSX 10.7 and up. Unfortunately Xcode 6 only includes SDK for 10.10 and 10.9. What is the best way to make sure I am not using any unavailable API's that would crash on...

iOS : pod update (unable to find the utility “xcode-select”)

ios,xcode,osx,xcode6,cocoapods
xI am a new iOS developer. Recently when I ran "pod update" sth just went wrong see the detail in the following: (unable to find the utility "xcode-select") bash-3.2$ pod install Analyzing dependencies sh: line 1: 4936 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find xcode-select 2> /dev/null xcrun: error: unable...

Coco2dx - Changing To Background Image

ios,iphone,xcode,xcode6,ios-simulator
I need someone's help. Actually I have no idea what to replace to get a custom background image. I'm just can't do it anymore. -(id) init { // always call "super" init // Apple recommends to re-assign "self" with the "super's" return value if( (self=[super initWithColor:ccc4(219,31,94, 999)]) ) { ws=[[CCDirector...

How can I fix crash when tap to select row after scrolling the tableview?

ios,xcode,swift,uitableview,tableviewcell
I have a table view like this: when the user tap one row, I want uncheck the last row and check the selected row. So I wrote my code like this: (for example my lastselected = 0) func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { var lastIndexPath:NSIndexPath = NSIndexPath(forRow: lastSelected, inSection:...

Swift error: Could not find an overload for '<' that accepts the supplied arguments

ios,xcode,swift
if (password.utf16 > 5) { var alert = UIAlertView(title: "Invalid", message: "Password must be greater then 5", delegate: self, cancelButtonTitle: "OK") alert.show() } i used the code as above and i got the error message : Could not find an overload for '<' that accepts the supplied arguments. may i...

Set CALayer Gradient Background

objective-c,xcode,osx,cocoa,cocoa-touch
I am trying to add a gradient to a CALayer I have created. I can set the background colour of the CALayer with the following: self.colorLayer = [CALayer layer]; [self.colorLayer setBackgroundColor:color.CGColor]; [self.colorView setWantsLayer:YES]; [self.colorView setLayer:self.colorLayer]; I've looked around with no success (surprisingly I thought this would have been answered many...

Extracting values from NSDictionary to individual variables

ios,xcode,swift
I really thought this was Xcode playing up as I can't for the life of me see what is causing this error in a fairly simple piece of Swift code but after restarting cleaning the project, restarting Xcode, and restarting my MacBook I'm still getting the same error.... But why!!??!!...

How do you work with views in MainMenu.xib?

objective-c,xcode,osx,cocoa
I'm coming over from iOS development and I can't figure out this basic thing: if I open MainMenu.xib in Interface Builder and I drag a button onto the main window's view, what class should I connect that button's action to -- the App Delegate? If I want to add a...

Testflight issue: can only install app on devices that were plugged in directly

ios,xcode,testflight
This is a strange issue we're currently having. We uploaded a new version of our application to itunes connect, and we sent it to the internal testers. However, only those where we installed some version of the application directly through XCode at some point are the ones who can install...

How to animate an object vertically with touch like Spotify's music player does when tapping the song,

xcode,drag,tap
Im using Xcode, and when i tap/drag on my imageView at the bottom of the screen, I want it to be brought up and reveal all of it on screen similiar to the way Spotify does it when you click the banner at the bottom. Any ideas?

change Auto Layout dynamically

ios,iphone,xcode,storyboard,autolayout
I have to show 3 Labels like LABEL1 | LABEL2 | Label3 //Horizontally I want these 3labels width are equally divided according to Screen size width How can I achieve this with nib file directly? Thanks Question 2 Label1 | Label2 | Lable3 //All Labels widths are equally //All Labels...

Clang Pragma Comprehensive List

xcode,clang,llvm
Where can I find the documentation of all possible #pragmas available in Xcode's Clang/LLVM? I found this in the Clang user manual, that at NSHipster, and even tried grepping through the svn repo, but still could not find documentation for things like _Pragma("clang assume_nonnull begin"). Any hints where to look?...

UITapGestureRecognizer sender is the gesture, not the ui object

ios,xcode,swift,uigesturerecognizer
I've got a button called and I gave it a UIGestureRecognizer so that an IBAction is only run when the button is long pressed. You do this by adding a UILongPressGestureRecognizer to the button iteself. Then you control drag that gesture recognizer to a function like this: @IBAction func handleGesture(sender:...

Java Server Pages, Java iOS and Codename One

java,ios,eclipse,xcode
Let it be known that I am an ASP.NET C# developer. A client of mine has brought me a Java iOS app, checkout the file structure and files: The webapps folder contains: And the iOS folder contains an Xcode project: There is an iOS app that you can download from...

UIView within a container view not showing

ios,xcode,swift
I couldn't get the blue rectangle view to show. IT is currently the subview of the grey view and has vertical/horizontal constraints. I don't have enough "reputations" to post images so heres the link to the screenshot: http://imgur.com/gallery/KCFA1O6/new Thanks....

Customisable iOS Interface

ios,iphone,xcode,user-interface,customization
I am currently developing an iOS app that can be used by different clients keeping pretty much the same interface for all of them. I would like to make this interface somehow “customisable” without having to change the storyboard for every client but I am not sure how to do...

Getting nil values in Swift when i create new Instance to the class

ios,xcode,swift,xcode6
I am getting problem in swift with the creating new instance to the class. I am setting a dictionary to HttpVo class in the httpUtils but unable to get that dictionay in other place by creating new instance to the same class. Thanks This is my demo project you can...

Getting video from Asset Catalog using On Demand ressources

ios,xcode,xcode7,ios9,asset-catalog
I attributed to my .mp4 video the "tokyo" tag for example, and set it as installed during the app installation. Now before I was using a Path to get it from my resources, now it's different because it's located on the Asset Catalog. After found documentations, I tried something like...

Run Code At Start of Class

ios,xcode,encapsulation
For a class where I have an actual view attached, I can use viewDidLoad to handle any variables or constants I want to use. It will run before any other code in the method the moment the view becomes in use. Is there something that does that for classes without...

Xcode UIWebView not changing page with changed URL

ios,objective-c,xcode,uiwebview
I'm automatically generating a NSURL based on the distance of a pan gesture on the screen (long story...). Anyways, I'm having no problem generating the URL. The URL dynamically changes, and then I have an NSTimer that repeats every second which tells a UIWebView to reload with the new URL....

Could not cast value of type 'UIImageView' (0x17c0f5c) to 'UIButton' (0x17c3298)

xcode,swift
I am trying to reset the board of my tic tac toe game but I get this error if I change i to 1 in my for loop everything works fine.I also changed the tag of my label, button and view from 0 to 20 but still i get this...

Read plist inside ~/Library/Preferences/

objective-c,xcode,osx
I'm trying to access in ~/Library/Preferences/ but my code doesn't work. NSString *resPath = @"~/Library/Preferences/"; NSError *error = nil; NSArray *filenames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:resPath error:&error]; if (!error) { for (NSString * filename in filenames) { NSLog(@"%@", filename); } } Maybe I should ask for some permission.. Any idea?...

Why label still append 0 once press clear button “C”?

xcode,swift
I am making calculator in swift. Functioning very well so far except the display which is UILabel. I want to get clear out display by pressing C button, for that I did this way inside clear() I wrote history.text ="\0" this is caused append 0 next time when press new...

Xcode 6 crashes on submitting Archive

xcode,xcode6
Today I uploaded my first build of first app successfully to App Store for beta testing. After making a few changes, when I tried to submit the new archive again Xcode crashed, and still crashes. It's the log: Process: Xcode [36810] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 6.3.2 (7718) Build Info:...

How to use tests in Xcode (iOS application)

ios,objective-c,iphone,xcode,testing
In every new project I see the file with the content (and this file belongs to different target ProjectNameTests): - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown...

Running app from console gets CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.1'

xcode,xctool
I am trying to run an iOS app from the console executing the following command: xctool/xctool.sh -workspace Supermaxi.xcworkspace -scheme Supermaxi build and I am getting this response [Info] Loading settings for scheme 'Supermaxi' ... (11036 ms) === BUILD === xcodebuild build Supermaxi Pods / Pods-FunctionalTests-KIF (Debug) ✓ Check dependencies (379...

How can I find out the Objective-C generics type?

ios,objective-c,xcode,generics
Xcode 7 contains an Objective-C variant, where you can define a type-hint for (homogenous) NSArray return values and properties, defined such as NSArray<UIImage*>. I'd like to use this feature to rewrite my JSON-deserializer class (which needs such kind of type hints – previously I have solved this by adding a -(Class)jsonHintForKey:(NSString*)key...

Why is the button not working

ios,xcode,swift
The "go button" is not working as it should. When clicked it should hide the subviews. Here's the ViewController. I tried placing the final function in various places. class timeViewController: UIViewController { var score = 0 var buttonState: Int = 0; var gameOver = UIView() @IBAction func start(sender: AnyObject) {...

Xcode storyboard versus @3x

xcode,storyboard,retina-display
Using storyboard on Xcode 6. I have 3 images [email protected], [email protected], bkg_menu_iphone.png Xcode automatically detect the regular and @2x(merge it together in the Media view, etc), but the @3x stay alone. Any idea why Xcode still not manage the @3x? My first idea was to have ONLY the @3x and...

Redundant conformance error message Swift 2

xcode,swift
I updated my project to Swift 2, and received a bunch of redundant conformance of XXX to protocol YYY. This happens especially often (or always) when a class conforms to CustomStringConvertible. Also some place with Equatable. class GraphFeatureNumbersetRange: GraphFeature, CustomStringConvertible { // <--- get the error here ... } I...

PFUser not unwrapped - swift

ios,xcode,swift
I'm beginning to learn swift with parse and i've run into this error: "Value of optional type 'PFUser?' not unwrapped; did you mean to use '!' or '?' I can't seem to get it to work... PFFacebookUtils.logInWithPermissions(["public_profile", "user_about_me", "user_birthday"], block: { user, error in if user == nil { println("the...

Query to retrieve a BOOL from Parse DB for the current logged in user, which will determine what segue to go to

ios,objective-c,iphone,xcode,parse.com
I'm trying to create a Query that will access a BOOL from the current logged in user's data from my Parse database. So far, when the user creates an account, the boolean profileCompleted is automatically assigned to NO as the user has not finished creating their profile. (This takes place...

How do I get a UILabel text to change randomly?

ios,xcode,swift
How do I get a UILabel text to change randomly? @IBOutlet weak var stoptimer: UILabel! stoptimer.text = String(arc4random_uniform(10)) ...

UISearchController shows incorrect results

ios,xcode,swift,core-data,uisearchcontroller
I have application with UITableViewController, two UIViewController and Core Data. I want to make UISearchController for the first time. I looked on the other questions by this theme, but I have working incorrect UISearchController. When I write into searchBar, it give incorrect results. And I don't know how show them...

TableViewCell overlaps text

ios,xcode,swift,uitableview,overlap
I'm having a problem with my TableViewCell I have two type of cell in my storyboard. when i scroll, the text overlaps in some cells. I Try everything but I do not know how else to do. thank you very much for the help public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath:...

How do i handle navigation Back button view hierarchy?

ios,xcode,swift
Here is the problem 1) Rootview controller - MYAssetVC-> Embedded with NavigationController here pushing for button to another Addfilevc. 2) Addfilevc Has dropdownTextfield It will push to another vc have tableview selected row will display in the textfield. 3)if i select another value from the dropdown textfield it will push...

Filter array based on coordinate from mapview frame in objective C

ios,objective-c,xcode,annotations,mkmapview
I have hundred's of map annotation. Annotation are from array of dictionary with lat and long val same data shown in table view. Table view and map view are same view based on screenheight/2. What I need for example in my array have 100 lat and long value table view...

ViewController Does Not have member named “allValues”

ios,xcode,swift,uiviewcontroller
This is kind of a common question, but I could not find an answer that solved my specific issue. I am creating a program that takes in a user entered credit card and returns the type of credit card. Everything seems to check out except I keep getting the error...

How do I add a reset function?

ios,xcode,swift
How would I add a reset function to the IBOutlet, currently when the button is clicked then the timer will start and when the same button is clicked again it will stop, but when it is clicked a third time it will start again, but I want it to reset....

How to change textView in separate ViewController from button in another ViewController?

ios,xcode,swift,button,uiviewcontroller
I have a Collections View that includes various cells that are also buttons. Upon clicking one of those buttons, a separate ViewController is shown (I just connected the button to the ViewController and clicked "show"). I would like to know how to switch the textView in that separate ViewController for...

Xcode Swift : Could not find member

ios,xcode,swift
if (PFUser.currentUser() == nil) { self.logInViewController.fields = PFLogInFields.UsernameAndPassword | PFLogInFields.LogInButton | PFLogInFields.SignUpButton | PFLogInFields.PasswordForgotten | PFLogInFields.DismissButton var logInLogoTitle = UILabel() logInLogoTitle.text = "Cinderella" self.logInViewController.PFLoginview.logo = logInLogoTitle //error: could not find member 'logo' self.logInViewController.delegate = self var signUpLogoTitle = UILabel() signUpLogoTitle.text = "Cinderella" self.signUpViewController.PFSignUpView.logo =...

How can I display the time offset (years, months, weeks, …) from two dates at my labels?

ios,xcode,swift
I am getting Use of unresolved identifier 'self' in my app. After reading this link, I wrapped the code in a class. Note: I am using an extension I got from this answer at S.O. class SetDate { var seconds = date2.secondsFrom(date1) var minutes = date2.minutesFrom(date1) var hours = date2.hoursFrom(date1)...

type casting in objective-c, (NSInteger) VS. integerValue

ios,xcode,casting
I don't very understand about the diference between (NSInteger)aNumberValue and [aNumberValue integerValue], then do some test. For example, here is a response data from server: You can see it's an int but the value is hold by NSNumber. I retrieve the data by writting NSInteger count = (NSInteger) dic[@"count"];, and...

Put Swipe Gesture over UIWebView to Get Scroll Direction in IOS

ios,xcode,scroll,uiwebview,swipe
I want to get the scroll direction in webView. I read the code about getting scroll direction here. -(void)userDidScrollWebView:(id)scrollPoint{ // NSLog(@"scrolled:::"); NSString *x1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollX"]; NSString *y1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollY"]; NSLog(@"scroll x=%@ y=%@", x1,y1); if ([y1 isEqualToString: @"0"]) { NSLog(@"RELAOD ME"); } } I have 2 Questions...

iOS 9 not supported on Xcode 6.3

ios,xcode,ios9
I downloaded the iOS 9 beta for the iPhone 5s and wanted to test an application that I have finished but now it says that my iPhone is an ineligible device. Is there a way I can still run apps on my iPhone without downloading the Xcode 7 beta?

Mask CALayer with Another CALayer

ios,xcode,swift,calayer,mask
I'm trying to mask one CALayer(newSticker) with the image of another layer(stickerMask), like so: func placeSticker(location: CGPoint) { let stickerMask = CALayer() stickerMask.contents = UIImage(contentsOfFile:NSBundle.mainBundle().resourcePath!.stringByAppendingPathComponent("brush\(self.stickerSelected).png"))!.CGImage stickerMask.frame = CGRect(x: location.x * 100, y: location.y * 100, width: 200, height: 200) let newSticker = CALayer() newSticker.backgroundColor = UIColor(red: self.red, green: self.green, blue:...

How do I create one button, but make it have two functions?

ios,xcode,swift
I created two separate buttons, start and stop, for a stopwatch. How do I combine that into one button. Click start, the timer starts, then the function should change so when clicked it would stop, then when clicked again, it would reset. @IBAction func start(sender: AnyObject) { if !timer.valid{ let...

Uploading Strings in an array of labels to parse

ios,arrays,xcode,parse.com,labels
I have an application with a lot of labels on it indicating numbers that the user chooses. These numbers are displayed in labels. The main goal of the app is to upload those numbers in an array to Parse. I'd like some help on which road I should take. I...

Swift 2.0 Errors

xcode,build-error,swift2
I am trying to use the following code: func redrawShape(shape: Shape, completion:() -> ()) { for (idx, block) in shape.blocks.enumerate() { let sprite = block.sprite! let moveTo = pointForColumn(block.column, row: block.row) let moveToAction: SKAction = SKAction.moveTo(moveTo, duration: 0.05) moveToAction.timingMode = .EaseOut sprite.runAction(moveToAction, completion: nil) } I get an error at...

Full CoreData uploading (backup) to iCloud Drive and restore if need

ios,xcode,core-data,icloud,cloudkit
My project is CoreData-based application. Is it enough to upload sqlite-file to CloudDrive for restoring data when need? Is there any tutorials how to implement it?

GCM support for ios application when application in background or killed

ios,iphone,xcode,android-gcm
Hello all i am integrating GCM in iOS application using following link https://developers.google.com/cloud-messaging/ios/start. I have also uploaded the certificates when configuring the file on defined steps. I have also succeeded for getting notification,but the problem is that i am not getting the notification when the application is killed or in...

Turn a switch Off or On on the basis of another switch state

ios,xcode,uiswitch
How can I turn a switch off inside a different switch? Here's an example - When the isMale switch is turned on, turn off the isFemale switch. - (IBAction)isMale:(id)sender { if ([sender isOn]) { //TURN isFemale SWITCH OFF } else { ... } } and - (IBAction)isFemale:(id)sender { if ([sender...

Xcode referencing old copies of files

ios,objective-c,xcode,file-management
Changes I've been making to code in certain files are being ignored by Xcode. I've traced it to the fact that Xcode is keeping its own older version of the code files somehow... these older/duplicate files are not shown anywhere in the Finder window for the project's folder and persist...

Swift timer in milliseconds

xcode,swift
I want to change the timer every millisecond but it doesnt work as expected. NSTimer.scheduledTimerWithTimeInterval(0.001, target: self, selector: Selector("advanceTimer:"), userInfo: nil, repeats: true); func advanceTimer(timer: NSTimer){ self.time += 0.001; let milliseconds = self.time * 100; let remaingMilliseconds = Int((milliseconds % 1000) / 10); let seconds = Int((milliseconds / 1000) %...

Xcode source control - git add

xcode,git,crashlytics,fabric-twitter
How do you perform 'git add .' using Xcodes 'Source Control' function? Im having an issue where I updated my project to use 'Fabric' and Crashlytics, instead of using Crashlytics by itself. Every time I try and commit I get following message: error: unable to index file Crashlytics.framework/Headers fatal: updating...

Switch between views using a Tabbar

ios,xcode,swift,ios8
I have an iOS application with a Tab Bar, and two subview. My first view is a Table View. So, I want to switch to the second view when I click on a cell of the first view, and keep the TabBar visible. When I do that using "Show" segue...

canEvaluatePolicy Extra argument 'error' in call Swift Xcode 7

ios,xcode,ios8,xcode7
I work with Xcode 7 with swift and I would use the Touch Id. Only I have a error when I use canEvaluatePolicy. I understand my error, I call an argument too. Only if I do not call, it makes me a error because I did not manage my error...

SKEmitterNode particles lag at start

ios,xcode,swift,particles,skemitternode
I'm playing around with SKEmitterNode in my own little game. I'm shooting a cannon ball and when the ball hits one of the boxes in the scene, the box gets destroyed and a particle effect with a simple texture "BOOM" is created to make a transition when the box disappears....

control may reach end of non-void function xcode

c++,xcode,visual-studio-2012
I have a third party library code segment which has the following structure: class A; A func() { if(...) { return A(...); } else if(...) { return A(...); } else { LOG(...); } } And it gives the error "control may reach end of non-void function" in Xcode. The same...

How to use existing SQLite database in swift?

ios,database,xcode,sqlite,swift
I know there are some resources available for this but none of them clearly show the way how to do it properly. I have already populated .sqlite database (MTrader.db) and i want to connect it to my swift project and load the data from the database into spinner. I tried...

Xcode + AWS Integration Apple Mach-O Linker Error

ios,xcode,amazon-web-services
I have a very simple Xcode project that I started and am now trying to integrate the Amazon Web Service (AWS) SDK into my project. I followed the instructions posted on their instruction page and everything looks good EXCEPT that I've got the following output... duplicate symbol _OBJC_CLASS_$_XMLDictionaryParser in: /Volumes/Macintosh...

fatal error: limits.h: No such file or directory

xcode,osx,gcc
On OSX, I can't compile simple programs from the command-line when I use an externally-provided compiler (e.g. gcc-4.8). System headers like limits.h cannot be found. Example error messages: fatal error: limits.h: No such file or directory Or: fatal error: stdio.h: No such file or directory and so on. What's wrong?...

When trying to get dynamically created UILabel to wrap, text disappears

xcode,swift,word-wrap,cgrect,sizetofit
I'm trying to display some description text that varies from a couple of words to a hundred words. I've set my UILabel to wrap to compensate using the code below descText.frame = CGRect(x: 115, y: 160, width: 465, height: 21) descText.textAlignment = NSTextAlignment.Left descText.numberOfLines = 0 descText.lineBreakMode = NSLineBreakMode.ByWordWrapping descText.sizeToFit()...

first tap not registering on collectionView Xcode

objective-c,xcode,ios7,uiviewcontroller,collectionview
I have a collectionView with an array populating it. I have it set up that when a cell is tapped a second modal view is presented. The problem is that the first tap is not recognized. The collectionView in storyboard, along with the cell and the image inside the cell...

Assign the value from a text field into an int variable to do some math with other variables and then return it?

ios,xcode,variables,textfield,assign
The code showing here assigns the value of an variables to the text field I want to do the opposite of that. _Initial.text = [NSString stringWithFormat:@"%f", init]; The opposite of the code above. Please help...

When trying to include “ in a String, using \” works but the \ is included too

xcode,string,swift,string-formatting
I'm trying to send a string to an Http request using the following code var outStr = "{product_code: \"660825\", quantity: \(qty)}" As I've included the \ character it compiles ok but when I run it the value for outStr is {product_code: \"660825\", quantity: 2} What am I doing wrong and...

Swift : pictures as Buttons

xcode,swift
I'm very new to App/Game design. I started with a basic app for my daughter. How to create as small picture as button in Xcode Swift? If I click that picture it should beep a sound.

How to always show debug window in XCode6

xcode,xcode6
I'm having trouble keeping my debug window open in XCode6. Every time I run the code the debug window disappears. I then have to press CMD SHIFT Y to show it again or use the upper right window icon. How do I make the debugger window stay at all times?

How do I make is so the entered number is mulitplied by the slider number

xcode,swift
So, I've created an iOS app that multiplies the entered number by the number that's in the slider. Please forgive my ignorance, but as you can tell, I'm just learning. The section where the user enters their number is the multiplier text field. I tried to convert it to an...

Transferring an Xcode project to another computer with all files/frameworks

ios,xcode,frameworks,transfer,projects
I am trying to copy over my Xcode project from one computer to another but it seems to lose frameworks and the locations for the images although i copied those too. PS I am using xcode and coding an app with a friend. Is there a useful source that can...

xcode 6.3.2 external build

c++,xcode,makefile,make
I'm trying to compile an existing c++ project, originally developed on linux with gcc. The only external library is GSL (GNU Scientific Library). I have created an external build tool project to use xcode's debugger, but I currently have two issues. 1) When I try to build in xcode it...

AutoLayout complains about constraints for 2 UITextFields with no borders

ios,xcode,swift,autolayout,nslayoutconstraint
I am trying to build my login view that has only 2 TextFields, and 2 buttons. I am applying the "Add Missing Constraints" property so that Xcode applies the corresponding constraints to all the elements in my LoginViewController in the storyboard. I am restricting my app to run only in...

Tic Tac Toe Game Algorithm considers it a draw if won on the last move

ios,xcode,swift
I am developing a tic tac toe game in swift. The logic i have so far works perfectly fine except that if a players wins on the last move it will consider it a draw. I have also tried different winning patterns to win on the last move but the...

UILabel autoshrink and use 2 lines if necessary

ios,objective-c,xcode,autolayout
I've got a UILabel that I would like to first shrink the text to fit a single line if possible. If that doesn't work I would like it to use at the most two lines. Is this possible? Currently with the settings I have it does this: Here is my...

Cannot subscript a value of type '[String]' with an index of type 'Int'

ios,xcode,swift,swift2,xcode7
I'm recently trying to build a custom UITableViewCell Class by adding a minor improved UITextField. I am also coding in swift 2 and I realised this error by recompiling the project in Xcode 7 beta. I initialised the array by call a custom init method. Heres is my Code: INIT...

Under Xcode 6.3, NULL C++ reference address evaluates as non-zero

c++,xcode,pointers,memory-alignment,type-safety
Similar to this question: XCode 6.3 Warning : Comparison of address of 'myObject' not equal to null pointer is always true with C++, I found that previously working code for evaluating null pointers stopped working: struct AStruct { int x, y; char *name; }; AStruct& GetStruct() { return *(AStruct*)0; }...

Cannot find my file

ios,xcode,swift,nsfilemanager
I have copied the file to the project and I am new to coding in swift, but I assumed that the file would deploy to my device with all the resource files in the project. this is my code which fails to find the file or copy from the bundle...

Chance of a conditional occurring in Swift: Xcode

xcode,swift,if-statement,conditional,percentage
I am quite new to Xcode and swift so sorry if this is a bad description. Is there a way that there is a chance of your conditional occurring so instead of it happening 100% of the time when the conditions are met, it only happens 50% of the time...

AFNetworking file upload

ios,iphone,xcode
I'm trying to upload file with AFNetworking and it is working with iOS Simulator but not working Real devices, i tried 2 different way but same. Can some one help me to solve this issue please Thank you very much. this is first code NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask,...

Non-Public Library SockPuppetGizmo

ios,xcode,apple-watch,watch-os
I got an email that my latest binary submission to Apple for an iOS/Watch OS app was invalid due to: The app links to non-public libraries in PlugIns/iPrayed.appex/iPrayed WatchKit App.app/_WatchKitStub/WK: /System/Library/PrivateFrameworks/SockPuppetGizmo.framework/SockPuppetGizmo I have submitted this build before without any issues, and only made a couple of changes to a few...

Swift 2 : NSData(contentsOfURL:url) returning nil

ios,json,xcode,foundation,swift2
I have a webpage address which contains a JSON file. I'm trying to access the JSON file as NSDictionary in Swift 2. Every time I call NSData(contentsOfURL:url!) where url is type of NSURL?, it returns nil. I'm using Xcode 7 Beta, and the project was first made in Xcode 6....

best way to create a mat from a CIImage?

c++,xcode,osx,opencv,opencv3.0
I am using CIDetector to detect faces, then using OpenCV on the lower half of each face to detect the size of any smiles. I am using the below code to create the cv::mat which OpenCV can perform the detection on, as you can see the image goes through the...

Can't figure out coder aDecoder: NSCoder

ios,xcode,swift
I'm making an app for archiving books, I'm at the point of hooking up a button to save the data, but I can't get past the initialisation. Here is the error Xcode is giving me : Property 'self.bookStore' not initialised at super.init call. And here is my code : import...

How to send users a photo with Parse?

xcode,parse.com,photos
I have set up an imageView in Xcode with a image from the camera roll and I want to be able to send this photo to other users that are already in the current user's friend list. I understand how to generally upload the photo, but I don't really know...

Move UIToolbar with keyboard iOS8

xcode,ios8,uitoolbar
I have a UIToolbar at the bottom of my ViewController that is inherited from the self.navigationController. I show it in my ViewController in the viewWillAppear: method using this code: [self.navigationController setToolbarHidden:NO animated:NO]; self.navigationController.toolbar.backgroundColor = [UIColor blackColor]; self.navigationController.toolbar.tintColor = [UIColor blackColor]; self.navigationController.toolbar.barStyle = UIBarStyleBlackOpaque; After that, my ViewController has both programmatically...

How does an SDK/framework works when included into xCode projects?

objective-c,xcode,swift,sdk
I am able to see the headers of the SDK, that means I am able to see what methods the SDK has but where is the actual implementation of those methods and how can I override the code that is automatically getting executed? And what about the .a files of...

Xcode - Colours look different but should be the same

ios,xcode,hex,uicolor
In my app, I am using the following color: #3D6D86 It is set to be a background color on a view controller and also to be the color for the navigation bar on a different view controller. However the problem is that the color appears different. I converted the hex...

How do I make randomized floats?

ios,xcode,swift
I currently have a line of code which creates random numbers 1-5, but how do I include decimals, 1.00-5.00? stoptimer.text = String(arc4random_uniform(4)+1) ...

Command-Line Testing Using Cocoa Touch

xcode,cocoa,kif
I have developed several test for an application, and I would like to run this application using the command-line. I have read this tutorial; however, I haven't been able to run them. When executing the following command: xcodebuild test -project MyApplication.xcodeproj -scheme MyApplication -destination 'platform=iOS Simulator,name=iPhone 6' I am getting...

Build error after I localized Info.plist

ios,objective-c,xcode,swift,localization
I localized Info.plist : And I got this build error : error: could not read data from '/Users/cherif/Apps/Wesh/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file. Actually there are now two Info.plist files : fr.lproj/Info.plist Base.lproj/Info.plist How to localize the Info.plist path ?...

How can I open an Image in a default Image Viewer by providing the path of the file?

ios,xcode,xcode6
In my project if a user clicks on an Image I will get the path with file name of the Image. I need to open the Image in a default Image Viewer of iPhone. Thanks in advance...