I use Xcode 4.0.1..Suddenly I noticed that my xcode stopped showing predictions...(for example if I use the name of the button and after that it use to show all the property of the button such as enabled,hidden etc)...My Xcode isn't showing any predictions now, it leads to some errors and consuming long time with out these predictions..Where I want to change this settings?
Sometimes exiting XCode and restarting clears up strange behavior like this. Also, Mac OS X needs a reboot from time to time. Unfortunate, but true.
Could it be that you haven't imported the correct class(es)?
I have this problem when I get the compiler confused -- like during a refactoring and a large block of code, protocol names, interface properties, etc. are being changed. I will clean and compile -- allow the errors, then it starts to work again.
Also, if I have unbalanced braces, brackets, parenthesis, etc. that precedes the code I am working on, then it will stop autocompletion. As soon as I balance the statement(s), it works again. Sometimes, I have to clean and recompile.
Related
Last Edit:
It appears I've had an F8 key being pressed non-stop, and it seems to be a shortcut for "Go to Next Error or Warning".
I've wrote a piece of code, it has an error which I'm aware of. Specifically, I'm trying to run a function which doesn't exist yet:
All good, I'm glad it is telling me there's a problem, but... I wish to keep writing stuff in the same file and I simply can't. Every so often the GUI keeps sending the caret (the place where my next piece of text will be written) to the beginning of the problematic piece of code. Simply speaking, I can't keep doing anything until I resolve the problem, since it forcefully intrudes my every action. Even more than that! When I go to a different file, with means of fixing the problem and adding the missing function, it once again interrupts me and forcefully takes me back to the problematic file to show me that there's a problem (??!?!?!). Closing it with "Esc" only closes it once, but it keeps on returning every several seconds.
I don't think it was like that just a week ago, and I didn't install any new plugin since then. I'm currently using the last version, 1.58.2.
How do I stop this work-flow-intruding behavior?
Edit:
I've kept on working for some time and it turns out the issue is much bigger than that. Whenever I type a name of some property, half way through some wild problem would jump and tell me "Cannot find name 'quar'. Did you mean 'quarter'?". The issue is basically the time delay of the problem checks, it's non-existent. It's also too intrusive, moving the caret and jumping between files to show me the existing problems. It's very recent, it didn't happen earlier this week. I've tried disabling different plugins I have and they're not the cause.
This is not exactly your issue, but could be related to what you are experiencing: https://github.com/microsoft/vscode/issues/68776
Try disabling the Outline Explorer and see what happens then.
Furthermore, see if disabling autosave improves anything.
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.
I'm not exactly sure how to debug this but it seems that I'm getting EXEC BAD ACCESS in the main function of my app. There's no trace or logs of what's going on. I have NSZombiesEnabled but it doesn't seem to be showing anything. How would I debug this?
The first step in debugging is to find out where the crash happens. To do this you need to be able to reproduce the bug.
The Xcode debugger will usually tell you where the crash happened. It doesn't happen in main(), that's simply the entry point for the app and the top of the call stack. You can zoom in to the call stack with the slider at the bottom of the Debugger pane (in Xcode 4).
If the stack trace doesn't include any of your own code, then you may need to set an exception breakpoint in the Breakpoints pane and try again.
If all else fails, you'll have to do some digging:
1) Find a reproducible case where you can make the app crash every time (or almost every time) using the same actions.
2) Since you know what you're doing to make the app crash, you roughly know where in the code you should look. Set breakpoints at strategic places (or use NSLog). After some fishing, you'll find the exact line where the app crashed.
3) Fix the problem. :-)
It may be helpful.
Mainly you are getting this error because you have released something which is useful in furthur.So try to focus on the release.comment the line where you have used the release
Have you tried too clean and rebuild your project, and restart XCode. Latest versions of Xcode sometimes does EXEC BAD ACCESS int the main function with no reasons…
Turns out, pushing multiple view controllers simultaneously will cause this. Hard to debug that!
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.
I am trying to debug a small prototype for an iPhone App (iOS Simulator 4.1), compiled as Debug, with all the configuration apparently ok.
The application makes use of Cocos2d graphic engine and GDataXMLNode library (for XML reading). There isn’t much stuff going on. But on certain method, if I set a breakpoint, gdb simply “stops”.
Here’s the status line of the debugger after it hits he breakpoint:
And here’s the code that has the breakpoint(sshot):
note: the breakpoint could be anywhere in that function and it’s the same.
And this is the calling code (from another object)
self.map = [SimulationLoader loadMap];
None of the Editor buttons work when a breakpoint is set inside the “loadMap" (step into, step out, next, continue execution, etc.). I can stop and/or restart the debugging and it works (but goes back to the beginning). The gdb prompt, will let me write, but nothing happens. I cannot view object values or anything debugging related. I cannot resume execution, it won’t do anything.
The strange thing is that, if I put a breakpoint before or after that line (the loadMap), it all works, and I can step out or in, debug it and do all I want to do.
What am I missing?
A couple of seconds after the “failing” breakpoint is hit (and it “hangs”) the stack window clears. I believe all this happens because the gdb has stopped, but the question is, why does it stop there? What are the restrictions for this?
I’m compiling with LLVM GCC 4.2 for what is worth (but could probably change to other if that’s the problem, haven’t tried that because I don’t know much about the differences).
Is there something (maybe in your Map class?) that requires timing? For instance, a double-tap that's being interrupted by the breakpoint's being triggered at that spot?
(i.e., no breakpoint => double-tap registered, Breakpoint => second tap comes after breakpoint hits, so only a single-tap is registered.)
I don't see anything like this in your code specifically, but that's the kind of thing that could show mysteriously different behavior between breakpoints on/off.