0

I made a connection between a textfield and the code using the storyboard line to code. When I did this, I forgot to first put UITextFieldDelegate on top. When I tried to use eventTitle.text it gave no error but it's not working either. When I type event and let the code complete it, it says "Error type" as type.

I think this all is because some weird connection issue between the code and the delegate. Because when I cmd+click on the UITextFieldDelegate OR any UITextField it says "Symbol not found" instead of bringing me to the protocol.

Any clue on how to fix this?

EDIT:

I noticed nothing is completing anymore.

Code:

import Foundation
import UIKit

class AddEventViewController : UIViewController,UITextFieldDelegate
{
// Outlets
//@IBOutlet var eventTitle: UITextField!
@IBOutlet var eventDesc: UITextField!
@IBOutlet var eventPrice: UITextField!

@IBOutlet var eventFacebookURL: UITextField!
@IBOutlet var eventImageURL: UITextField!
@IBOutlet var eventURL: UITextField!

@IBOutlet var eventCity: UITextField!
@IBOutlet var eventGEOLatitude: UITextField!
@IBOutlet var eventGEOLongitude: UITextField!

@IBOutlet var eventDate: UIDatePicker!
@IBOutlet var eventType: UIPickerView!
@IBOutlet var eventMinAge: UITextField!
let eventController = EventController.sharedMonitor()
func buttonClicked()
{
    var parameters: Dictionary = Dictionary<String, String>()
    parameters["apikey"] = "tftmr0x"
    //eventController.apiController.performPostRequest(parameters)
}
@IBAction func addEventButtonClicked(sender: AnyObject) {
    if(checkRequiredFields() == true)
    {

    }
}
func checkRequiredFields() -> Bool
{
    if(eventTitle.text == "" || eventDesc.text == "")
    {
        let alert = UIAlertView()
        alert.title = "Hey"
        alert.message = "This is  one Alert"
        alert.addButtonWithTitle("Working!!")
        alert.show()
        return false;
    }
    else
        {
        return true;
        }
    }
}
Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
Kraishan
  • 443
  • 5
  • 14
  • 38

1 Answers1

1

I'm pretty sure it is a bug in Xcode 6.1. I'm not positive the cause, but for me it seems like it pops up when I have an error.

Some people have had success by deleting Derived Data (Window -> Organizer -> Select your project and Click Delete... next to derived data.)

That sometimes works for me. Other times, a complete reinstall of Xcode fixed it.

Others have luck by avoiding building using the simulator: [Xcode autocomplete stopped working

Community
  • 1
  • 1
  • Well, indeed. Deleting the entire Derived Data folder fixed it! Weird bug though... Thanks for your answer! – Kraishan Nov 06 '14 at 21:10