XCode warnings go away after subsequent Build calls - iphone

In XCode, let's say I call a method that doesn't exist. Well, XCode gives me a nice little warning when I click "Build." Then, if I immediately click "Build" again, that warning goes away mysteriously! How do I fix this? I don't want my warnings to ever go away :)

Try selecting the All option for your build information

Other way is to clean all targets and build again :)

Related

eclipse turn off compilation on the fly

I cannot find where is the option to turn off showing me compilation errors and warning "on the fly", while coding. I want it to just show me that after debug/run code try. I was looking for in project properties and view properties but cannot find it. Could you help?
While it can be turned off, I'd suggest leaving it on. You want feedback as early in the process as you can get it.

Compiling my App gives no errors but hangs when compiling on device

I've made an iPad App. I was able to run this App on my device and on simulator.
After I've updated several classes (which I tested in simulator) I wasn't able to run my App on my device. It gives no errors but just hangs when compiling.
I'm thinking it's something with a class which came out very large and has some mathematical functions inside (calculations of transforms etc.)
After a long runtime Xcode gives back this error (something about a 'clang error'):
Anyone has any experience with these kind of issues and could find a solution?
EDIT:
Within my viewdidload method i have set 112 float values (i.e. value = 12;) and save them (with NSUSerdefaults).
Only setting these values solved my problem. No idea why this was giving me compile errors. I'm thinking the mathematical functions (after setting the float values) took to much memory or CPU.
Did you try cleaning your build and rebuild again?
Menu > Product > Clean
close & reopen XCode, "Clean All Targets" then rebuild. It should work.
Clean your project, delete the app from you iPad and try again. Should work.
Hope it helps
Are you trying to "Build and Analyze" or an ad-hoc build or debug build?
If your code crashed because of any memory issues or bad access memory due to any infinite loop, try to enable NSZombieEnabled in your executable settings. It will point you to the code snippet where the code crashes.
To enable "NSZombieEnabled", go to
Edit Active Executables -> Arguments -> Variables in the environment -> Add name as "NSZombieEnabled" and value to "YES"
Hopes this helps.

Does Xcode Always Compile from Scratch

I sometimes see that change I made shows up on third or 4th build run. It's as if xcode "cache" old compilation.
How to delete all compiled file and start from scratch
One thing that's particularly frustating is this:
I got a compile warning
for this code:
[self.currentBusiness addCategoriesObject:self.currentCategory];
I know what the problem. The automatically generated core data code do not have
- (void)addDistrictsObject:(District *)value;
- (void)addCategoriesObject:(Category *)value;
on Business.h. The function is defined in Business.m though.
So I added those 2 lines. Guess what, still the same warning. I had this exact same problem several time with no issue. I know the solution. I put the line right there in business.h. Nothing changes.
Yet now I get the same compiler warning even though the method is CLEARLY defined in business.h.
As if xcode do not care about the last change I put.
I am so frustated. I added #import "Business.h" again in my utilities.h. Shouldn't change anything given that "Business.h" is already included through other channel. Guess what, it works.
But then I thought, ah that's the problem. I curiously remove that //#import "Business.h" again so it's back like usual. If that's really the issue then the error should show up again right? Wrong.
The error is gone.
So changes I made do not show results right away. Either the compiler or the precompiler must use some sort of cache.
This is important. There are bugs that are introduced 2-3 builds before that I don't know how to debug. If code changes right after the first build after I make that change I know that something is wrong.
Also that autorestore doesn't seem to work. I create a snapshot, restore the snapshot into another directory and get lots of compile error.
NO, It only compile the file in which any kind of any editing took place.
Xcode does incremental builds. You can do a clean build by going to the Product menu item and select Clean (or press Shift+Cmd+K). That will delete all intermediate files and start from scratch.
Click xcode -> Empty Caches.
Here is a screenshot.

Xcode 4 is no longer showing me where my warnings are?

Xcode 4 has stopped showing me the locations of build warnings that I have. How can i get it to start showing me them again?
Make sure you're looking in the right place. On the left-hand side of Xcode (4), look for the little error symbol. Click it and enjoy your errors in all their glory.
If you click on the errors and it doesn't take you to the location in code, I think something must be messed up with your Xcode install. I remember you had another question earlier about Xcode problems, so it wouldn't hurt to uninstall & reinstall.
In Xcode 4.3.1. I have one project that doesn't show any warnings, but others do.
So it's not an Xcode issue I guess.
In the Issue Navigator (⌘4) be sure to clear the filter at the bottom left of the screen:
Just click on the x at the right, at the filter will be removed -- worked for me!
Check the below SO post
(iphone) Is there a way to see compile output of xcode4?
press command + 4 for issue navigator. (there are two filter here "By File" and "By Type")

My breakpoint is not working please give me some suggestions as to why not

While debugging the program my breakpoint is not working, so please give me some advice so that it can work properly.
Maybe you've tried to use the breakpoint on unreachable code? Try setting your breakpoint somewhere before the point you want to reach and try stepping from there to see if the point is actually reached.
Possible Reasons could be.
1. After changes in the code you have not built the libraries properly so the breakpoint is not pointing to the right location in the code.
2. If you are putting a breakpoint in a library then make sure the library is build and is built in Debug mode.
3. Clean full environment and rebuild the project.
Open XCode preferences and in the Debugging tab, un-check "Load symbols lazily", this caught me out when I first started iPhone developement. Then again, it might be for any of the other reasons that people have already mentioned.