1

I am not sure what is causing this problem, but I now cannot create outlets. When I create an outlet it appears and works fine in code, but does not appear under the view controller in storyboard. Old outlets have a warning symbol on them like this

When I remove this outlet, its gone and does not appear back to connect. I am running Xcode beta 6.2 because moving to 6.2 temporarily fixed this problem because I was having it beforehand in 6.1.

Here is the .h file of this class

#import <UIKit/UIKit.h>

@interface DashboardViewController : UITableViewController {
   NSString *currentDay;
}
@property (nonatomic, weak) IBOutlet UILabel *dayLabel;
@property (nonatomic, weak) IBOutlet UILabel *blockLabel;
@property (nonatomic, weak) IBOutlet UILabel *currentClassLabel;

@end

and here are the outlets listed in storyboard enter image description here

enter image description hereThese are the details of the warning, but this is .h file's code for this class

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface InfoViewController : UIViewController {
  IBOutlet UIScrollView *AISScrollView;
  IBOutlet MKMapView *AISMapView;
}
 -(IBAction)studentHandbook:(id)sender;
 @end
15
  • r u deleted the button action in anywhere in your view controller Dec 1, 2014 at 10:12
  • can you add the .h of the view controller?
    – Gal Marom
    Dec 1, 2014 at 10:19
  • check in interface builder the view is connected or not? if view is not connected means shows like that only. Dec 1, 2014 at 10:23
  • looks fine.. what does the warning say?
    – Gal Marom
    Dec 1, 2014 at 10:25
  • 1) restart xcode, 2nd) check if class file is same for viewcontroller on storyboard.
    – Sheshnath
    Dec 1, 2014 at 10:28

3 Answers 3

1

Oddly enough, I ended up finding a solution and that was moving the project out of the directory that it was in. It was in my Dropbox folder and moving it out fixed. If anyone has this problem in the future and also happens to have the proj in their Dropbox, move it out.

2
  • I don't know why I didn't think of this before, seems so obvious now. Thanks man! Moral of the story don't use Dropbox :) Jan 13, 2015 at 19:07
  • @JoeBarbour I love and use Dropbox every day. Just don't use it for an Xcode Project. Jan 14, 2015 at 9:31
0

try to change this:

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface InfoViewController : UIViewController {
  IBOutlet UIScrollView *AISScrollView;
  IBOutlet MKMapView *AISMapView;
}
 -(IBAction)studentHandbook:(id)sender;
 @end

to that:

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface InfoViewController : UIViewController {

}
@property (nonatomic,weak) IBOutlet UIScrollView *AISScrollView;
@property (nonatomic,weak) IBOutlet MKMapView *AISMapView;

 -(IBAction)studentHandbook:(id)sender;

 @end
7
  • 1
    Changing the code to this does not do anything. When I remove the outlet that has the warning, the outlet just disappears and is not available to reconnect. Dec 1, 2014 at 14:05
  • I would suggest you to split the view - one side put the .h and in 1 side the xib. Ctrl+drag the UIViews (MKMapView and UIScrollView) from the storyboard to the .h and choose touchUpInside: or whatever you need. What is the output?
    – Gal Marom
    Dec 1, 2014 at 14:23
  • When I try to control+drag the outlet from the .h file into the views with the Xcode split view enabled, it just won't highlight the views when I hover over them. Nothing happens when I release. Dec 1, 2014 at 16:04
  • try to do it the other way around - storyboard to .h - it should linked it automatically. but before discard the outlets at the .h and erase the connector at the storyboard. do clean just for case.
    – Gal Marom
    Dec 1, 2014 at 16:37
  • So this created the outlet again, but the outlet appears with the warning symbol when created. The outlet says that no outlet with that name exists which is obviously not true because that outlet was setup by CTRL+Dragging. Dec 1, 2014 at 19:08
0

Just in case someone suffers from the same thing again, the best answer inside this other thread did the trick for me:

XCode 6: can't connect any IBOutlet to ViewController

Removing the .h and .m files from the project (their references) and readding them again was the solution that worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.