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
Eytan Schulman
  • 566
  • 2
  • 4
  • 20

3 Answers3

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.

Eytan Schulman
  • 566
  • 2
  • 4
  • 20
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
Gal Marom
  • 8,499
  • 1
  • 17
  • 19
  • 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. – Eytan Schulman Dec 01 '14 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 01 '14 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. – Eytan Schulman Dec 01 '14 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 01 '14 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. – Eytan Schulman Dec 01 '14 at 19:08
  • Weird... it's obviously a bug. Try to restart the computer, clean the project... – Gal Marom Dec 02 '14 at 10:01
  • Restarting the computer is unlikely to have an effect here. I'd suggest cleaning the build folder (Cmd-Opt-Shift-K) to clear the index. If this doesn't work, please file a Radar at bugreport.apple.com and include a sample project that reproduces so we can investigate. Do the connections work at runtime? Any console warnings? – Quinn Taylor Dec 03 '14 at 03:53
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.

Community
  • 1
  • 1
Isaac
  • 1,794
  • 4
  • 21
  • 41