Type error Xcode 6 swift - swift

I having issues with Xcode, I connect my element (button) to an IBOutlet but when I try to access button, it gives me the <>> message where it should be a completion suggestion. I have connected correctly my storyboard with my view controller. Here's a screenshot, so you can see. I hope you can help me. Thank you. Ok, I have not enough reputation so I will put an URL to the image.
http://i61.tinypic.com/28at08x.png

Just delete the app and download it again from AppStore.

Related

XPC connection interrupted in Xcode 7 for iOS 9

I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6.
Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled.
I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first.
I have a button that segues to a view controller with a WebView. This view controller loads a link that will display either an image, website, or video from youtube. The content is loaded perfectly fine as always. However, the program will crash and reboot the simulator (and my iPhone) and send me to the lock screen when I click the Back button (I am on a navigation stack).
In Xcode, I get the following messages:
XPC Connection Interrupted.
Terminating since there is no system app.
I have Flurry analytics integrated in my app by the way, not sure if thats an issue.
How can I fix this issue? My searches for XPC connections do not seem to return problems similar to mine. I do not even have a clue what an XPC connection is, so why is this in my app anyway?
EDIT: I have found a workaround for the issue. I cannot really say it is a fix.
The crashing was occurring during the use of the method self.navigationController?.popViewControllerAnimated, when set to true. I happened to set this to false, and the crashing stops (now the transition looks awful).
I do not know why this works, and just adds to my confusion.
The problem lied in the storyboard for me as well. I created a new project and laid out the views and everything seemed to be working fine. I found these couple lines in the storyboard source (right click on storyboard and select view as -> source code) which weren't common between the working version and the broken version:
<keyCommands>
<keyCommand/>
</keyCommands>
I have no idea what those lines are supposed to do, or how they crept into my storyboard file, but they were what was crashing the app so hard that the phone had to restart. I removed those lines from my main project and everything worked again.
This error can be caused by executing a loop repeatedly. In my case it was a 'for' loop in which I reset the counting variable. As soon as I added an NSLog in the loop it was obvious.
I just faced the same problem. I don't know if that will help you, but I also think it's coming from the Storyboard:
In my case, the problem is coming from a UITextView. Whenever I try to change the default text inside it, I have this error. If I let the default text or leave it empty, the app works fine. Making an IBOutlet and changing the text programmatically works as well.
I tried with other UI elements, but only the UITextView seems to have this issue.
I have struggled with exact same error. Through a process of elimination I established that it had nothing to do with the any class but had to do with the storyboard. Luckily I keep regular backup copies and I tried to compare storyboards to establish what I had done - but could find nothing obvious.
The backup copy worked fine and I was able to copy my controller classes (from the faulty copy with the changes) into the backup copy and they worked fine.
I think there is a bug possibly in storyboards.
I have same error message when I place a subview in -layoutSubviews method:
-(void)layoutSubviews
{
[super layoutSubviews];
[self populateByImageViews];
}
It causes infinite cycle of layout process and crashes app. Don't place subviews in this place!
Deleting UITextView from the one of the view in Storybord removes the error in my case.
In valueChanged: method of a UIControl, I had the same problem
so I made the code inside valueChanged: to run in main thread and it solved the problem.
#IBAction func valueChanged(sender: AnyObject) {
dispatch_async(dispatch_get_main_queue(), {
//code
}
}
For me was some missing constraints with a UISearchBar, but the error was only in the simulator.
I only add some constraints and works better
For me it was xcode live issues caused by IB_DESIGNABLE
If you have any IB_DESIGNABLE in source files, the system's live tracker will check for issues in StoryBoard too. It may leads to unnecessary building.
To disable it-
Open Storyboard file. Editor -> Automatically Refresh Views (Uncheck)
If you needs to Disable Live issue tracking
XCode -> Preferences -> General -> Issues -> Uncheck Live Issues
Reference
My issue probably originated with some storyboard issue, but I cleaned the project, restarted Xcode AND restarted the simulator app and that fixed it.
When using QLPreviewController, I am confronted with this problem. Error messages as follows,
XPC connection interrupted
_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)
Since XPC means OS X interprocess communication, so I think this can solve the problem, especial when updating the UI
dispatch_async(dispatch_get_main_queue(), ^{
// do what you want to do.
});
For Swift 4+, user
DispatchQueue.main.async {
//Your Code
}

Cannot connect UIImageView with ViewController. Did they change that?

This is my first time being on this forum. It's nice to be here and i really want to thank you all for the educational lessons you are giving!
So i am suffering from this issue :
i am using Xcode 7 and i did try with the latest Xcode of yosemite(6.4 version) and it seems i cannot establish an outlet connection via the old ctrl and drag method to connect a UIImageView with the ViewController. i did search the net a bit and i found some "solutions" of doing a reference to the header file but it didn't work. Did this method got removed and if yes how are we connecting now an element with the ViewController? is something wrong with my Xcode and if yes how can i fix it?
really appreciate your help!
First of all create outlet object
than go to storyboard or xib.
right click on file's owner (yellow box on top of xib).
you get all the outlet than click on circle right side of your outlet and map with UI by dragging the line.
hope this help you.
in this method you have to create outlet manually.
So yeah i did manage to fix the issue. It appears there is a bug with swift and Xcode and i can tell it happens in all Xcode version 6 and up including Xcode 7. I don't know what exactly occurs this bug and i can't really link an element from scoreboard with ViewController via the simple ctrl drag and drop method but in order to fix i had to reimplent the tableView and reconfigure my elements. this did the trick and i was able to just ctrl drag and drop. if someone knows what occurs this issue please comment!!
thanks

Cannot add a UIDatePicker to an xib without generating an Internal Error

I am using xCode 4.0.2 and trying to create a view controller with an xib that contains a UIDatePicker. Whenever I try to drag a UIDatePicker object to the view in the xib I get an Internal Error alert. This is a universal app and I am using an xib targeted for the iPhone.
Has anyone else experienced this or have any suggestions on how to work around this problem?
For now I am going to work around it by adding the UIDatePicker to the view in code.
Also, when I click the Crash button in the alert I am not getting the Crash Reporter. Isn't the Crash Reporter supposed to come up automatically? If this is a bug, how can I otherwise report it?
Thanks,
John
if you are using the Xcode UI and it crashes, assuming you don't have any huge environmental problems, no disk space... etc, that is a bug; and you should report it to:
bugreport.apple.com

App crashes when trying to use UITableView

When launching my tab-based app, it crash when I'm trying to navigate to a tab with a UITableView in it, probably due to Interface Builder wrong connection I've made.
I have absolutely no idea why... I'm getting crazy over here!
I've simplified my code so now it contains 2 tabs; when trying to navigate to the non-active tab, the app crashes with no further explanation.
I've posted the simplified source here: source download.
Any help will b appreciated.
Load the name of the UIViewController in tab. VideosGalleryViewController was not mentioned in the class. Check the screen shot attached.

IPhone App Build Successful But nothing shows

Very new to Iphone development here, I have a project which is successfully building (which is a first for me :) It loads the simulator but it just closes as soon as it loads, how can I debug this? It appears the Interface Builder xib files are not loading, I've added a xib thats from a hello world project, (they have different project names) Is this an issue?
Any advice would help,
Thanks!
You probably have an error in the Debugger Console. If it has to do with the XIB, it could be that you simply got the name wrong.
Another simple mistake is trying to use Outlets before viewDidLoad is called (for instance, in init).
In either case -- the message in the console will help.