iboutlet

IBOutlets not being set EXCEPT when creating throwaway variables during initWithNibName:bundle:

你离开我真会死。 提交于 2020-02-08 06:28:04
问题 Let me first say that I've searched Google and, although many have similar issues, I haven't seen anything with the following bizarre behavior and remedy. I've created a UIViewController and associated nib with several IBOutlets. On trying to consume this nib from another class, I discovered that after instantiating it with initWithNibName:bundle:, the IBOutlets are still nil. I confirmed that they are correctly wired up, and yes, they are being synthesized, but still nothing. While

IBOutlets not being set EXCEPT when creating throwaway variables during initWithNibName:bundle:

你说的曾经没有我的故事 提交于 2020-02-08 06:25:26
问题 Let me first say that I've searched Google and, although many have similar issues, I haven't seen anything with the following bizarre behavior and remedy. I've created a UIViewController and associated nib with several IBOutlets. On trying to consume this nib from another class, I discovered that after instantiating it with initWithNibName:bundle:, the IBOutlets are still nil. I confirmed that they are correctly wired up, and yes, they are being synthesized, but still nothing. While

IBOutlets not being set EXCEPT when creating throwaway variables during initWithNibName:bundle:

萝らか妹 提交于 2020-02-08 06:25:05
问题 Let me first say that I've searched Google and, although many have similar issues, I haven't seen anything with the following bizarre behavior and remedy. I've created a UIViewController and associated nib with several IBOutlets. On trying to consume this nib from another class, I discovered that after instantiating it with initWithNibName:bundle:, the IBOutlets are still nil. I confirmed that they are correctly wired up, and yes, they are being synthesized, but still nothing. While

UIView class properties seemingly disappear when I call drawRect:

好久不见. 提交于 2020-01-17 04:44:05
问题 I am coding an objective-c project with xcode. I have two important files that are being used: a viewcontroller, and a view. My view is class "PlayingCardView", my viewcontroller is class: "PlayingCardGameViewController". Here is what PlayingCardView.h looks like: #import <UIKit/UIKit.h> @interface PlayingCardView : UIView @property (nonatomic) NSUInteger rank; @property (strong, nonatomic) NSString *suit; @property (nonatomic) BOOL faceUp; @end Here is the important code from PlayingCardView

IBOutlet does not display its value in UI

故事扮演 提交于 2020-01-11 13:29:09
问题 I am building an iOS app using storyboards.I have implemented google maps in my app using swift and rest of the code is in objective C. My scenario: 1.As shown in the diagram, when I click on the label in front of location ( in First view controller ) a modal segue opens a second view controller containing map. 2.In the map view controllers, when the user moves the map with touch, I'm getting address value in a label. ( similar to uber app ) 3.After this , as soon as user presses done button

fatal error: unexpectedly found nil while unwrapping an Optional value in Swift

我的梦境 提交于 2020-01-05 02:32:43
问题 So I'm trying to get the text of an input field in Swift. So here's what I got class ViewController: UIViewController { @IBOutlet var passwordField: UITextField! @IBOutlet var usernameField: UITextField! override func viewDidLoad() { super.viewDidLoad() //Try to log user in by default let user = usernameField.text let password = passwordField.text It all looks good (I know I didn't close the class, I just pulled it directly out) and when I go to run it, I get fatal error: unexpectedly found

Nil while unwrapping an Optional IBOutlet value

主宰稳场 提交于 2020-01-04 06:08:39
问题 I have got a fatal error: unexpectedly found nil while unwrapping an Optional value for an IBOutlet . In my custom view, I have associated my outlet with a XIB file. I have double checked this. This is how it looks like: @IBOutlet weak var label: UILabel! { didSet { label.textColor = .redColor() } } My implementation of layoutSubviews looks like: override func layoutSubviews() { super.layoutSubviews() label.preferredMaxLayoutWidth = label.frame.size.width } Despite the fact, that

Xcode 4.3: duplicated connections of an IBOutlet

随声附和 提交于 2020-01-02 08:43:48
问题 I am learning Stanford CS193p course with Xcode 4.3.3. I think the screenshot below is pretty much self-explaining. But i will describe the problem with words anyway. I control-drag a UILabel from storyboard to corresponding implementation file to make the IBOutlet @property. Then I see two connections displayed when clicking the filled circle in the left side of the editor where shows line numbers. I don't know how to delete it. Moreover, I see only ONE connection in storyboard's connections

Custom InfoWindow for marker Google Maps SDK, Swift 2.0

流过昼夜 提交于 2020-01-02 08:42:17
问题 I'm trying to implement this (https://www.youtube.com/watch?v=ILiBXYscsyY) Custom InfoWindow tutorial that was done for Objective-C in Swift 2.0. I have tried doing this by just mix-matching Objective-C and Swift code, but I have been unsuccessful in translating - (UIView *) mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker { CustomInfoWindow *infoWindow = [[[NSBundle MainBundle] loadNibNamed:@"InfoWindow" owner:self options:nil] objectAtIndex:0]; infoWindow.name.text = @

IBOutlet is nil inside custom UIView (Using STORYBOARD)

天大地大妈咪最大 提交于 2019-12-29 20:27:41
问题 I have a custom UIView class. Inside it I have declared an IBOutlet property for UIImageView . #import <UIKit/UIKit.h> @interface SettingItem : UIView{ } @property (strong, nonatomic) IBOutlet UIImageView *myImage; @end Now i am using storyboard. There is a viewcontroller. I dragged UIView to viewcontroller. I dragged one UIImageView as a subview of above UIView . I set the "SettingItem" class to UIView from storyboard. I connected the outlet to myImage by normal dragging from outlets of