TRENDING NEWS

POPULAR NEWS

What Is Wrong With Xcode

Whats wrong with this C++ code (hello world)?

include "../../std_lib_facilities.h" // get the library facilities needed for now
int main() // main() is where a C++ program starts
{
cout << "Hello, world!\n"; // output the 13 characters Hello, world!
// followed by a new line
return 0; // return a value indicating success
}


My lecture notes said to just copy and past this into the box and compile it, but I keep getting
: fatal error C1083: Cannot open include file: 'std_lib_facilities.h': No such file or directory

What am I doing wrong?

Wrong Apple ID in Xcode?

I just started using Xcode, and I did the "hello world" tutorial app for iOS. I tried running it on my phone, and it initially said that there was no public/private certificate pair. I fixed that, got both certificates, both are saved on my computer and in my keychain. Now, when I try to add my phone to the "Member Center", it says my Apple ID password is wrong. Now, I didn't change this at any point up until I got this error. Thinking that Xcode might have screwed it up, I typed in my Apple ID password. This is not what Xcode was looking for. I tried some of the other alphabet soup passwords stored in my Keychain as "app passwords"; none of those worked either. I have no idea what password it's looking for. The same password unlocks my macbook, app store, apple ID, all that stuff. Aaaaaaaand... now that's not working I guess. Any ideas?

How the f@%& do I do c++ in xcode?

You can start learning C++ with these video tutorials:
http://xoax.net/comp/cpp/index.php

They are perfect for beginners. This one can get you started by showing you how to install a free compiler:
http://xoax.net/comp/cpp/console/Lesson0.php

Here are some simple games with code downloads that you can use to get some ideas:
http://xoax.net/comp/cpp/console/Lesson9.php
http://xoax.net/comp/cpp/console/Lesson23.php
http://xoax.net/comp/cpp/console/Lesson29.php

These tutorials can get you started with graphics programming in OpenGL:
http://xoax.net/comp/cpp/opengl/index.php

You can go through the tutorials and if you have questions on them or anything else in C++, please post to me here:
http://xoax.net/forum/

Enjoy!

Why is Xcode so bad?

First off, make sure you're using the latest stable version of Xcode, currently 4.4. That will probably help with a lot of the bugs.Long story short, Xcode is probably the most complex application Apple develops, and it has relatively few users compared to, say, iPhoto. That probably causes the Xcode app's team to be a bit smaller at Apple and perhaps stretched a bit more thin than other teams.Also keep in mind that Apple has been making some pretty sweeping transitions to its toolchain. They previously used GCC as their compiler and they have basically swapped that out with LLVM/Clang.  Given that Xcode in many ways is a frontend for these tools, that means key components of Xcode had to be rewritten. Put on top of that many of their changes that they made to make the app App Store friendly and bugs are going to crop up.Apple will surely keep plugging away at fixing the bugs as it finds them and identifies root causes, and I'm confident in that Apple is hiring the absolute smartest people for the job. It's admittedly a little disheartening to see that random bugs like this are considered acceptable, though, I admit. It reminds me of a Microsoft of the 90s when we just put up with buggy software because Microsoft was the market leader. That being said, Apple's making some damn impressive advancements with getting Objective-C easier to develop with.  New features like automatic reference counting, better debuggers and these awesome new object literals just wouldn't be possible if not for the work Apple has put into LLVM.

What does Xcode error "expected expression" mean (writing in C++)?

I am new to Xcode. I am writing in C++. In the following bit of my code, on the line that has the closing paren for case 1, Xcode has the error "expected expression." But it doesn't put that error on either of the other lines with only closing parens on them. I also tried just putting the closing paren on the line just after the break statement with the semicolon of course, but the error remained. What am I missing?

Xcode also is giving me an error on the line in case 1 "cout << permutation(n, k) << endl;" that reads "expected ')'." I don't understand what is happening there either. The error goes away when I put an ending paren after the line, but then I can't break the switch statement and of course that opens up a whole other can of worms. Please help.

while (true) {
switch (option) {
case 1: (
cout << permutation(n, k) << endl;
option = 0;
break;
)
case 2: (
cout << endl << combination(n, k);
option = 0;
break;
)
default: (
cout << "Something went wrong with the first entry. Please enter 1 for permutation or 2 for combination. ";
cin >> option;
break;
)

}
if (option == 0) break;
}

C programming: creating files in xcode?

I am working on another assignment: write a program that sequentially displays on screen the contents of all of the files listed in the command line. Use argc to control the loop. Below is my code. The reason why I can't check it is because I don't know how to create a file in xcode or at least not in the way that is required for this program. I tried from the main terminal (I am working on a mac) creating files but the program doesn't read them. Either the program is wrong or the files are not saved in the command line. I am a beginner with almost no experience so I would really appreciate some help, thank you!

#include
#include

int main (int argc, char * argv[])
{
char ch;
int i;
FILE *fp;

for(i = 0; i < argc; i++)
if((fp = fopen(argv[ 1 ],"r"))==NULL) {
printf("Cannot open file.\n");
exit(1);
}

while((ch = fgetc( fp )) != EOF) {
printf("%c", ch);
}
fclose(fp);

return 0;
}

What is wrong with the syntax for this class?

For C++, I seem to be having some problems adjusting a bit. I know java, but I need a bit of help with this.

#include

using namespace std;

class object{
private:
int x;
int y;
public:
object(){
x=5;
y=6;
}
int getx(){
return x;
}
int gety(){
return y;
}
~object(){
}
int add(){
int z = x+y;
return z;
}
};

int main(){

object o;

cout << "x: " << o.getx() << endl << "y: " << o.gety() << endl << "a: " << o.add();


cout << o.add();

return 0;
}

I wold expect the output for o.add() to be 11. But this is what I'm getting when I run.

The Debugger has exited with status 0.
[Session started at 2009-06-23 15:09:19 -0300.]
x: 5
y: 6
a: 1111
The Debugger has exited with status 0.

What am I doing wrong here? Am I creating the instance correctly? It seems a bit weird to just put object o, compared to java, object o = new object(); :P

Any help appreciated.

What is the meaning of a breakpoint in Xcode?

Breakpoint is not a great name. It should rather be called pause point.And that's exactly what is it, a point in the app execution, where the execution pauses.The idea is that often you'll want to check the state of variables at a specific point in execution, to see if everything is as you expect. It is an invaluable debug tool to find bugs in your code.You can set breakpoint in specific points of your code, and you do so by clicking on the left, next to the line numbers, and when that line of code is about to be executed, the execution will pause and you'll be able to inspect the current context.You can also set breakpoints at specific events rather than specific lines. One very useful in XCode is to add an exception breakpoint, so that every time you get an exception in your code, it pause right there and you can check what was wrong that might have caused it. You can add one of those by going to the breakpoints pane in XCode which you access by tapping the breakpoint icon in the top icons bar on the left pane where you have the project file structure for example. On my version of XCode that is the 7th icon from the left, or 2nd from the right. When in the breakpoint pane, you go to the bottom of it, and there is a + button in there and in the context menu you can pick "Add exception Breakpoint...".Further reading:Breakpoint

Why is Xcode so bad and arduous?

What you’re describing having trouble with isn’t specifically XCode’s fault, but to answer your larger question: Apple is great with consumer products, but terrible with professional products. Their mantra of make it simpler doesn’t work for tools that are meant for power users. In the last few years it seems Apple has relegated the design of its professional products to people who haven’t ever used those tools professionally. (And truthfully they make way more money from their consumer products, so you can’t really blame them for focusing on them.)As far as alternatives, depending on your tech stack and how much of an IDE vs Editor you want: others have mentioned JetBrains AppCode. There’s also Eclipse, Qt, Intel XDK, Xaramin Studio, Atom, Visual Studio Code, NetBeans. You typically need XCode to build your package for submission to the App Store though.

Xcode storyboard showing code?

I was coding an app in xcode and i must have pressed a wrong combination or something, because now my storyboard file is showing as if it were a text file, with a lot of code in it. How do I get it back to the default graphical mode?

TRENDING NEWS