Xcode build - stuck on Compiling Swift source files - xcode

When building my project in Xcode 8 GM, Xcode sticks on "Compiling Swift source files". It also never finishes indexing my project at any point.
I've looked at the similar questions but none of those answers work for me.
Does anyone know what this could be?

Swift inference was the problem.
There were several instance where I was inferring a dictionary type that for some reason grew exponentially as the dictionary had more values.

If you used lot of Concatination of string like
var fun=0;
var tempvalue=2;
var result="some data"+fun+" more data"+tempvalue;
Transform it to
var result="somedata \(fun) more data \(tempvalue)";
Because swift compiler take lots of time to analyse overloding methods of "+" operator

Clean Build Folder (Cmd+Shift+Opt+K) usually helps me in this case, but time to time issue returns.

Related

What's the easiest way in Xcode to search exclusively for all writes to (or reads from) a variable

I find myself doing this from time to time and I end up just doing a search on the variable name and then looking through all the hits, skipping the ones that aren't what I'm looking for. But it occurred to me that if Xcode could reliably filter into one set or the other, it would make the process more efficient. Because quite often one only needs to know where a variable is changed in particular, so reads don't really matter then.
I can think of some ways eg. searching for "setXXX" and "XXX =" etc. but that all seems a bit clunky and imprecise. Is there a better way?
I am mostly coding in Objective-C and am looking for a way to do a static search of the source code.
What I do when I want to search for a symbol in Xcode I use the built-in search tool as you suggested in your question and that is good enough for me. However, if you want better tools for static analysis of obj-c code I'd suggest XClarify from CodeGears. It became free for open source contributors and research.

Changing generic value in Quartus doesnt affect the result of compilation

I've got an issue with generics in Quartus.
They do work, but if I declare let's say n = 10, and later change it to n = 100, the compilation and simulation results do NOT change. It's as if the generic value was still n = 10.
I've tried recompiling the design, but it didn't work. I've tried deleting temporary files, by removing all directories in my project folder, but still nothing. I've tried archiving the project and restoring it - nope.
Only copying the content of VHDL file, inserting it into a new file with a different name, and recompiling seems to work.
Is there a way to force Quartus into acknowledging the generic value has changed? I suppose I could give those values a thought before inserting them, but for obvious reasons creating a new file, creating a new symbol, and changing the main design file is a BIT of annoyance. Any idea what can I do about that? Is there anything?
Looks like top level schematic .bdf file is here at fault. Ive tried updating symbol after recompiling, it doesnt help. Deleting and re-adding component does help. After ditching main graphic file, and setting my VHDL design as top-level entity (with generic inside) simple re-compilation solves the problem.
Good job, Quartus. Good job.
The problem is in top.vhd. To use generics with schematic view you need to do this:
take in focus <your_top_bdf_with_generics>
go to "File"
click "Create\Update"
click "Create HDL Design File for Current File"
After this your generics will be used.
GL

NSClasses vs Swift new classes

I have been reading apple documentation and I couldn't find an answer for this questions.
In the new variables we create in Swift should we be using some of the old NSClasses (like NSDictionary) or should we use the new Swift classes (like Dictionary).
I am trying to keep consistent in use Swift classes everywhere I can but is there any difference in between the two (in this case NSDictionary and Dictionary)
Did anyone find something about this topic in the apple documentation?
This is not a duplicate of "What is difference between NSDictionary vs Dictionary in Swift?"
I know the differences and I know that one has the root class NSObject and another has the root class AnyObject. Reformulating my question I want to know how that affect me as a developer? Did anyone did a benchmark? Is it fast slower? Is apple planning to make the NSClasses obsolete in the future? And I am not limiting this discussion to NSDictionary but to the whole new variables in swift that substitute the variables pre existents in Object-C
Swift classes provide type safety which means you assume less while working with objects inside collections. So it always better to use Swift variants than Objective-C wherever possible.

Ridiculous amount of warnings in xcode 6 beta 7

In Xcode 6 beta 7, my warnings are divided into two sections, for example if one is called "my app" the other would be called "my app project". I have fixed all warnings I have received in the "my app" section ( there were only 3-4). On the "my app project" section however, I have over 42,000 warnings! It has been this way since before I even wrote any code and created my empty project. I always assumed this was a beta issue but I would like to know if everyone else is experiencing the same thing. I am unable to even look at what the problems are as Xcode freezes when I try due to the overwhelming number of warnings.
The release notes provide some details into the errors, seems to be the evolution of Swift:
http://adcdownload.apple.com//Developer_Tools/xcode_6_beta_7_apzr94/xcode_6__beta_7_release_notes.pdf
From the release notes:
Swift Language
• A large number of Foundation, UIKit, CoreData, SceneKit, SpriteKit, Metal APIs have been audited for optional conformance, removing a significant number of implicitly unwrapped optionals from their interfaces. This clarifies the nullability of their properties, arguments and return values of their methods. This is an ongoing effort that started shipping in beta 5.
These changes replace T! with either T? or T depending on whether the value can be null or not null, respectively. If you find a case that was changed incorrectly, please file a radar and include the tag ‘#IUO’ in the subject line. Please do not file feature requests about APIs that are still marked as T!, we know about them.
If you encounter a method for which the return value is incorrectly considered non-nullable, or a property that is incorrectly considered non-nullable, you can work around the problem by immediately wrapping the result in an optional:
var fooOpt: NSFoo? = object.reallyMightReturnNil()
if let foo = fooOpt { ... }
I haven't had any issues like that in any of the releases including Xcode 6 Beta 7. Each beta release I usually end up with about 100 or so errors due to changes in syntax but they only take half an hour or so to go through and resolve.

VB6 app controlling Word behaves differently during debug than when compiled

I have a vb6 app that uses Word interop to create a few reports. In the introduction of these reports, there are some instructions in 4 textboxes around an image.
Recently and suddenly the top two textboxes started appearing on the next page, and I can't figure out why. When I step through the code and watch the word document getting built, everything positions itself correctly, however, if I compile the application, the error reappears.
Any suggestions?
Use late-bound calls to Word. This does not mean to remove reference to Microsoft Word Xxx Object Library, just alter your Dims like this
Dim oWord As Object '--- was Word.Application'
Dim oDoc As Object '--- was Word.Document'
...
oDoc.Protect wdAllowOnlyReading '--- keep using enums'
Could it be some 'rounding' difference? For instance if you compare two float point values for equality, the result can subtly depend on the specific compiler/interpreter implementation.
I would like to suggest to trim down your code to the minimum showing the different behaviors. That might clear things up already. If not, please post it here to let us help you.
Maybe you are running the compiled version as a different user than the one running VB when you debug? Maybe this could cause what you are describing, if the two users have some different Word settings.
Is it possible that the compiled version finds a different version of the .dot file?
It may be very helpful if you show the code you use to create the Word document, because then someone here might notice something that can be sensible to moving to a compiled version.
Do you have any code in events that rely on timing, such as Form_Activate, Load, or Unload? I've seen those things behave very differently when stepping through code and when compiled, especially on newer, faster machines.

Resources