Xcode prompting to bridge swift with objective c when rebuilding model - ios

I've made changes to my Core Data models. I've selected Editor > Create NSManagedObjectContext Subclass. Clicked next, next, next. Now xcode is prompting for confirmation on "would you like to configure an Objective-C bridging header".
Last time I did this I had no problems (xcode 7, swift 2.3). It created the correct Swift files. I'm now using xcode 8, swift 3.
I have no Objective-C code in my project.
When I click "Dont create", xcode creates .h and .m files with Objective C code in it.
How do I solve this?
Thanks.

Solved.
Select model.xcdatamodeld on the left, then in the File Inspector pane (far right, icon looks like a new document icon). Change Code Generation to Swift, form Objective-C.

Related

Xcode incorrectly binding Storyboard elements to Exit

Developing in Xcode 9.3 Beta 2, had some issues with with BarButtonItem (fix), but then got some crashes. So removed then re-added the logout button, but drag-and-dropping gives me this callout:
Setting the type to UIButton and name to logoutPressed, but that didn't work:
More info:
EDIT: Traced it down to wrong ViewController binding. But checking tableViewController in XML, and it has the correct customClass and customModule set. Same on the GUI. How do I rebind?
How do I get drag-and-drop component binding working again? - Or alternatively: how do I manually bind in XML?
I found a solution, launch Xcode 9.2, copy everything from your old storyboard file to a new one, delete the old one, rename the new one Main.storyboard, that fixed it for me
Make sure you drag to the right class file

How to be able to use UI component from framework in Storyboard?

I would like to use an UIView subclass from an external framework in my project's Storyboard. I tried with different projects but each time I can't see the class name in the custom class dropdown menu.
Is it possible to make it work?
I guess the frameworks are fine, it should be an import/linking problem.
One thing could be that you are using a mix of swift and objective c like your project is in swift and your framework is in objective c in that case you need to add bridging header and import your .h files in it. It will work if that's the case

Objective-C code recognized as Swift code in Swift project

I imported the objective c class I wanted to use into my bridging header but once I did, Xcode seemed to recognize the objective c code as swift code. What should I do to tell Xcode that the class is an Objective c class?
You might have gotten the file type wrong in XCode.
Click the folder icon on the left to switch to the project navigator in the left pane
Select the header file UIImageView+PlayGIF.h
Click the file icon on the right to switch to the file inspector in the right pane
Check and possibly fix the type of the file
The correct file types are:
"Default - C Header" for header files with extension .h
"Default - Objective-C Source" for Objective-C files with extension .m
"Default - Swift Source" for Swift files with extension .swift

Why does my Xcode 5 doesn't autocomplete nothing?

I'm starting a project but I have another one very similar as base.
I create my new project with storyboard and CoreData, create a new file of NSObject class, and when I start writing in the .h file:
#property (nonanatomic, retain) ns...
nsstring or any type of variable doesn't appear... for example, I start writing ns and it appears:
NS_DURING
NS_ENDHANDLER
NS_HANDLER
NS_VALUERETURN
NS_VOIDRETURN
and the most of code is in black letter, i mean, nothing is coloured as it shoud be normal like purple, blue, etc... the colour that xcode sets... here you can see it:
http://oi61.tinypic.com/359iws6.jpg
P.S: I'm using Xcode 5 Preview 3 and OsX Mavericks. I've never had this problem I think.
Possibly your dot-m (the implementation) file is not a member of the target.
When adding a new file to the project on the bottom of the save dialog there is a Target Membership window . Did you check that box?
To view the target membership and/or to add an existing file to your target open the implementation file. Then open the File Inspector using ⌥+⌘ 1 or View, Utilities, Show File Inspector.
In the File Inspector window halfway down there is the Target Membership. Check the box next to your target.
Syntax highlighting will begin after a short moment, wait for Xcode to finish its indexing.
Try out this: In XCode open Preferences, click on the Text Editing Tab and make sure "Use Escape key to show completion suggestions" is checked.

Drop-down functionality in xcode 4.2

I have upgraded my xcode version from 3.2.6 to 4.2 .
Is drop-down functionality inbuilt in xcode 4.2 so that i can directly drag and drop it on
interface builder and feed values to it .
Thanks .
Followings are steps to drag the variable on xcode 4.2
1.select the editor mode of the xcode
2.select the files to which the change aries like .xib file and .h file
3.Now drag the button and put into xib file
4.Right click on button and select new refrence.
5.Drag and select the name of the variable here.
6.Enter the name of the variable here.
7.It show below optput like this
It may be helping to learn new funcationality.
Happy codeing
#neon samuel

Resources