w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » XCODE » Page 1
Xcode OS X Storyboards: How do I get a reference to the top level "window content" view controller?
I'm mainly an OS X guy, and I'm new to StoryBoards myself, but I think what you need to do is: Write your -(IBAction)someResponse:(id)sender {} method in the view controller that plans to handle the action. Wire the Control so that it sends its action to its FirstResponder. If your view controller is in the responder chain, it'll receive it.

Categories : Xcode

Breakpoint stops but no exception
It is the All Exceptions breakpoint. AV Foundation is throwing an exception and also catching it, so no harm, no foul (which is why the app can resume without a problem) - but you are set to break when that happens, so you do. When the app runs for real (independent of Xcode) no one will know; it's just Xcode and your All Exceptions breakpoint that brings it to the surface. AV Foundation is full

Categories : Xcode

Disable and Enable UIButton - XCode Swift
The variable you're referencing (btnGuess) is declared as a function in your code here: @IBAction func btnGuess(sender: UIButton) { You may want to change the action function's name to @IBAction func guess(sender: UIButton) and then declare a @IBOutlet weak var btnGuess: UIButton! property.

Categories : Xcode

Add UI View to Storyboard
I have tried this tutorial and found a solution for you all you need to do is Click on you UIView and set the class name FBLoginView Like this Way: After that you can connect your outlet this way: First click on UIView in your storyBoard after that connect the Outlet and you will find fbLoginView. May be this will help you.

Categories : Xcode

Xcode - Cannot Adopt Protocol
That means you have not implemented the methods defined in the protocol. Look at the documentation to know what you have to implement. In this case, it's just a method: func messageComposeViewController(_ controller: MFMessageComposeViewController!, didFinishWithResult result: MessageComposeResult)

Categories : Xcode

UIGestureRecognizer iOS
Alright! The problem was that I my view was moving from out-of-the-screen inside with in animation. The View is moving but not the GesturRrecognizer. When I set the startPosition of the View to x=0 and y=0 it works. Thank your for the help Maiaux!

Categories : Xcode

NSStatusItem not showing image and title
You are setting the image size to nonsensical values. NSSquareStatusItemLength is -2. It's a sentinel value, not an actual length. You would need to use systemBar.thickness to determine the actual size that would be used for a square status item. Regarding the deprecated methods, in 10.10, NSStatusItem has a new button property. This should be used instead of the now-deprecated view property (wh

Categories : Xcode

Why can't I run git commands after updating to OSX 10.10?
If you find that which git returns /Library/Developer/CommandLineTools/usr/bin then you are dependent on xcode functionality and its associated TOS. If you install through another mechanism, brew or via GitHub command line tools, you would not receive this prompt. You may want to make sure your other version is earlier in your path: $ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Categories : Xcode

Convert NSString to few NSIntegers
Edit: Since you are not much specific, I will try to cover your situation. If i count with the fact you have NSString *frame filled with {{1848,594},{154,176}}: NSString *stringWithoutLeftBracket = [frame stringByReplacingOccurrencesOfString:@"{" withString:@""]; NSString *stringWithoutRightBracket = [stringWithoutLeftBracket

Categories : Xcode

XCode Swift - Deleting from core data
An NSManagedObject is simply deleted by passing it to the NSManagedObjectContext.deleteObject(...) method. So you first need a reference to the NSManagedObject for your user, then: context.deleteObject(user)

Categories : Xcode

Can't create an NSBitmapImageRep in Swift
The error is actually fairly descriptive - you're providing an inconsistent set of values to the initializer. Specifically, the samplesPerPixel value of 1 can't support a RGB color space, which you specify in colorSpaceName. From here: samplesPerPixel: The number of data components, or samples per pixel. This value includes both color components and the coverage component (alpha), if present.

Categories : Xcode

performSelector afterdelay still running even though I have unloaded the viewcontroller that it originated from
Not always. It depends on your classes, if you have a strong reference to the controller or the timer somewhere it may not actually be released. It could also be that since the timer was never invalidated it's keeping the view controller from releasing. Timers are interesting in that they can cause behavior like this if not invalidated, it's always good practice to clean them up when you're done w

Categories : Xcode

Blank app icon in iOS app
I have removed the assets folder from the project and then created a new asset catalog. Closed project. Moved old json and png files to under new asset catalog folders. Reopened XCode. Works. Currently I can't browse files under the Images.xcassets folder in the project navigator, whereas before I could. Perhaps this can be an indicator to you if you encounter similar problems.

Categories : Xcode

Swift Playground - Files are not readable
I have to thank Nate Cook for first for his quick response and solid answer. Just for case I share his answer from another post, which title is misleading. See Nate's answer here: http://stackoverflow.com/a/26723557/2360439 Playgrounds are sandboxed, so you won't be able to just grab files from anywhere in your user folder. Here's how to add that file to your playground to make it accessib

Categories : Xcode

UIAutomation with bwoken and tuneupJS
I found similar issue in the bwoken GitHub repository issues section. What you need to do is to look up the available devices by doing: instruments -s this will print the list of available devices similar to this: Known Devices: Jakub’s MacBook Pro [FFBE27F6-3076-59B7-B14F-40E92F1366FD] iPad (7.1.2) [07056cc29131036c74d215ba52a9be605dc9e64a] Resizable iPad (8.1 Simulator) [26038DBD-791C-421

Categories : Xcode

All Simulators (except one) went away from Xcode
Solution: I've just got the solution to my own question. Go to window -> devices Hit "+" (bottom-left) and create the simulator-definitions you need enjoy your workday :-) Have a nice day!

Categories : Xcode

Parse Push Notification Not Working Properly on IOS 8.1
In iOS 8 registering for remote notifications was slightly changed: if application.respondsToSelector("registerUserNotificationSettings:") { let userNotificationTypes = UIUserNotificationType.Alert | .Badge | .Sound let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil) application.registerUserNotificationSettings(settings)

Categories : Xcode

Changing the name of my app?
select your target under "Targets" in the project editor, then choose View > Utilities > Show File Inspector. Xcode opens the File inspector, which includes the Identity and Type pane. Enter your application's new name in the Project Name field then hit the return key on your keyboard. Xcode displays a project-rename dialog that contains all the items that can be renamed in your project. Leave yo

Categories : Xcode

Chartboost integration issues with XCode 6.1
EXPLANATION: It seems like some pods and libraries don't bother importing the basic frameworks as they expect your code to already have them. This doesn't work with Swift as the way to import frameworks changed. All you need to do is to add the frameworks needed in your bridging header file. ANSWER: In your specific case, it is complaining about NSObject, NSString, etc... so you need to add #im

Categories : Xcode

Xcode Swift tableview cell seperator lines being cut off
I'm thinking what your problem is comes down to not having AutoLayout constraints set properly. Select your table view in your storyboard and make certain that you pin the left and right sides to the parent view. Here is what it looks like when I do it in Xcode: I clicked the "Add Constraints" bottom after setting the left and right margins to be "0" pixels separated between the left and ri

Categories : Xcode

Cancel Button in UIAlertController with UIAlertControllerStyle.ActionSheet
Its really simple, but works a bit differently to how they used to work. Now you add "actions" to your alerts. These actions are then represented by buttons on the device. alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil)) Above is the code needed for a simple cancel button - bear in mind that dismissal of the alert is done automatically so don't put

Categories : Xcode

X-Code:(user defined runtime attribute)Range with minus value. Alternativ?
Then I would suggest you to define two NSNumber properties with suitable names to represent NSRange value instead of abusing CGSize as using CGSize confuses other readers/programmers as we there is a saying, we code for others not for ourselves. And there is a NSNumber class method as follows + (NSNumber *)numberWithInteger:(NSInteger)value which allow you to wrap signed integer value as you

Categories : Xcode

how to make old xcode project AppIcon and LaunchImage support iphone6?
Select either of the assets. Open the Utilities pane on the right side of Xcode. Show the Attributes Inspector (click on the fat down-arrow icon). Turn on the checkboxes for the iOS 8 / iPhone 6/6+ related icons and launch images.

Categories : Xcode

Localisation English appears double
Take a look at your file structure. I guess you have more than one Base.Iproj folders You should have one in FOLDER/APPNAME Base.Iproj/Main.storyboard (if you have an localizable.strings file used with Base Localization you also have one in FOLDER/Base.Iproj/Localizable.strings ) Anyway I think it dont do any harm.

Categories : Xcode

collectionView:didSelectItemAtIndexPath - does not get called
When animation is in progress touch events is disabled. This is default behavior. In order to enable touch events you need to give the option UIViewAnimationOptions.AllowUserInteraction

Categories : Xcode

Cropping image doesn't work with UIImagePickerController setAllowsEditing:YES
Because you are getting original image not edited one. You need to capture edited image. Edited Image (use this) self.chosenImage = info [UIImagePickerControllerEditedImage]; Orginal Image (not this) self.chosenImage = info [UIImagePickerControllerOriginalImage];

Categories : Xcode

Core Graphics drawings incorrectly scaled and translated in device but okay in Interface Builder
Check this line: UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:self.frame]; That should be self.bounds, not self.frame.

Categories : Xcode

Make button hyperlink Swift
You can open a URL by calling the openURL method on the UIApplication instance: @IBAction func WebLink(sender: AnyObject) { if let url = NSURL(string: "http://...") { UIApplication.sharedApplication().openURL(url) } }

Categories : Xcode

XCode Workspace How To Add Same as Visual Studio Style Sheet
I gather that by "style sheet" you mean a group of settings that can be applied to each project within an Xcode worksheet (for example, ensuring that different projects use the same set of compiler flags). This is done by using .xcconfig files ("Configuration settings files") as the basis for configurations within each project. First, start by creating a new .xcconfig file. In Xcode, choose File

Categories : Xcode

Include non-modular header inside framework module with Allow non-modular includes set to YES
Have a look at this sample project: https://github.com/tomaskraina/swift-modules-reachability It consists of a ApiFramework and a ReachabilityApp and demonstrates how to set it up so you can use Reachability both internally in the framework as well as externally - in the app.

Categories : Xcode

Xcode doesn't export strings from xibs for localization
I did it! Turns out, it was a project created in old Xcode version that doesn't support Base Internationalization. I had to Press “Localize” on all the xibs in the project Then go to Project Settings and in the Info tab check “Use Base Internationalization” checkmark. After this, the resulting .xliff file has all the .xib strings.

Categories : Xcode

Add preprocessor macro to a target in xcode 6
I've done a screenshot to show where it is in Xcode, because it's easier :) Select project file Select the target you want Go to Build Settings Search for 'preprocessor' Add your preprocessor macro either for Debug, Release, or both.

Categories : Xcode

How to increment build version in xcode with date and constant
This solution for "N1.90" format variant. https://gist.github.com/shevyakov-nikolay/c87cd9841279985d64b1

Categories : Xcode

custom title bar for NSWindow
Yes, OS X Yosemite uses a new NSTitlebarAccessoryViewController API for adding custom subviews to the titlebar: NSWindow has never supported clients adding subviews to anything other than the contentView. Some applications would add subviews to the contentView.superview (also known as the border view of the window). NSWindow will now log when it detects this scenario: "NSWindow warning: adding

Categories : Xcode

Implement Yosemite Reminders/Notes/Messages/Contacts style windows
This is a combination of two new NSWindow options. Include NSFullSizeContentViewWindowMask in your window's styleMask to make the content view of the window stretch up behind the title/toolbar. Enable the titlebarAppearsTransparent property to disable rendering of the translucent title/toolbar material so that the content view shows up in the title/toolbar area without getting blurred.

Categories : Xcode

How would I repeat an action forever in Swift?
You can repeat the function execution with NSTimer. override func didMoveToView(view: SKView) { self.addChild(sprite) var timer = NSTimer.scheduledTimerWithTimeInterval(0.2, target: self, selector: "doAction", userInfo: nil, repeats: true) } This will repeat your function execution for every 2 second. EDIT : You can do it this way too : override func didMoveToView(view: SKVi

Categories : Xcode

How to add unlock screen or use TouchID with Security in Swift?
TouchID and the device passcode are very different from one another. TouchID is really just a more convenient means of authenticating a user without requiring them to type in a password. This password is NOT the same passcode used when unlocking the device but rather a passcode that unlocks your App. This means that if your App already has some type of authentication system in it then TouchID can

Categories : Xcode

Xcode shows swift errors while editing despite compiling
From the apple documentation : NSApplicationDelegate needs an import statement import AppKit This may solve your problem.

Categories : Xcode

Understanding the Instruments Time Profiler column headings
Recent versions of Instruments don't have a Total Samples column, but I'll explain the difference between total samples, total time, and self because it explains how the Time Profiler instrument works. The Time Profiler instrument records the call stack periodically, every millisecond by default. The Total Samples column tells you the number of samples a method was in the call stack. The Total Tim

Categories : Xcode




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.