Xcode5 Simulator: Unknown Option Character 'X' In: -Xlinker

Failed to launch simulated application: Unknown error

Recreating project step-by-step showed that it was directory structure.

I've had directory named 'resources' with resources for my application. That directory was added to the bundle as is (via Folder References feature).

When I renamed that directory to less common name, error went away.

So, never name any custom directories in the bundle 'resources'.

Guys from Xcode (or simulator) team could improve their error reporting. I've had to spend whole day debugging this issue. :-(

iOS - Part of interface not showing up in simulator - Interface Builder

This is an issues concerning AutoLayout. If you turn off the option "Use Layout" in your .xib, all labels are displayed correctly.

So something must go wrong while setting the constraints. It seems, like the content hugging priorities of the buttons were equal but too low. As a result, some button labels were cut off (alternating from one compile to another). For me setting the vertical "Content Hugging Priority" of each button object to required (= 1000) fixed this problem.

Unknown class and NSUnknownKeyException in Xcode 10 GM

The problem is that your project name (and all that follows from that) is not pure ascii alphanumeric (in particular, it contains a diacritic, an "é" character). This can mess things up in subtle ways. I don't know why Xcode 10 chokes on this but Xcode 9 doesn't, but there it is.

The solution is to change the project name and allow the renaming cascade that this causes. Then edit the Display Name so that it's the way you want it; that's the user-facing name of the app, and an "é" in that is perfectly fine.

Can't compile plcrashreporter in Xcode 4

You are correct in that the file does not exist normally, nor does crash_report.pb-c.c exist, which will be your next error after this one.

The crash_report.pb.h and crash_report.pb.c files are generated at compile time through a build rule. You need to add a custom script to your build process to make them.

First, make sure you have protoc-c in the plcrashreporter folder of your project (plcrashreporter-1.0/Dependencies/protobuf-2.0.3/bin/protoc-c). They buried it deep. This is what your script will be running.

Then find your crash_report.proto file. This is the main input that protoc-c will be using to create your missing files. You can take this directory and put it manually into your script, OR you can make a rule to run the script on every *.proto file. I do the latter.

Then edit your build rules to include a script that runs protoc-c with the flag --c_out="${DERIVED_FILES_DIR}" and your crash_report.proto file as two inputs, this will output crash_report.pb-c.h and crash_report.pb-c.c into the same directory as where your crash_report.proto file is, which should already be accessible in your project.

The build rules in Xcode 4 (and above) are under your project's target's build rules tab. You add a build rule before all your other build rules. Here's what mine looks like in Xcode:

Here's what mine looks like in Xcode.

You'll probably have to fiddle with the directory

Xcode cannot run using the selected device

  • Clean up your project using Clean, Clean folders, Delete derived data.
  • Delete all schemes from 'manage schemes'. Recreate them, and build using any of them that contains a version of iPhone simulator (the one that worked earlier).

If that doesn't work, try this:

  • Clean up your project using Clean, Clean folders, Delete derived data.
  • Using your favourite editor, try clearing all the profile strings from your project.pbxproj file (the one that you see when you open your xcode project using 'Show Package Contents' command).

See below image - you must delete all lines containing 'Provisioning Profile' till the ; character.

  • Then restart xcode. Select the profile using automatic profile selector and build using an iphone simulator scheme.

Sample Image

Unknown type name using YACC with xcode

I have looked at this and have some answers, but unfortunately, not a complete working example in the time available. I am very familiar with lex & yacc but have not worked with Objective-C before. This was my first Objective-C exercise I'm afraid, and it was my weakness in that part that let me down. Perhaps your better knowledge in that area will allow you to complete the task.

The first part of the problem, as hinted at by @Ewan Mellor, is explained in the bison manual* where it indicates that yacc generates code in the wrong order for some languages/compilers. This is true for Objective-C which is what causes the compilation error you are receiving. This means, specifically, that the %union construct of yacc is difficult to use in conjunction with Objective-C objects (as you have discovered).

There is another way of solving this problem as shown (at the end of) this article.

One uses the YYSTYPE macro to replace the type used by yacc instead of the %union.

I made the following changes to use this method:

In MessageBlocks.h:

@interface HYPLangNodeNP : NSObject
@end
@interface YYresultType : NSObject

- (float) value;
- (NSString *) identifier;
- (HYPLangNodeNP *)node;
- (void) setvalue: (float)input;
- (void) setidentifier: (NSString *)input;
- (void) setnode: (HYPLangNodeNP *)input;

@end

In MessageBlocks.m:

@implementation HYPLangNodeNP : NSObject

int dummy;

@end

@implementation YYresultType : NSObject
float value;
NSString *identifier;
HYPLangNodeNP *node;

- (float) value {
return value;
}

- (NSString *) identifier {
return identifier;
}

- (HYPLangNodeNP *) node {
return node;
}

- (void) setvalue: (float)input {
value = input;
}

- (void) setidentifier: (NSString *)input {
identifier = input;
}

- (void) setnode: (HYPLangNodeNP *)input {
node = input;
}

In tokenizer.lm:

[0-9]+\.[0-9]* { [yylval setvalue: [float atof(yytext)]]; return FLOAT; }

[0-9]+ { [yylval setvalue: [float atof(yytext)]]; return INTEGER; }

[a-zA-Z]+ { [yylval setidentifier : [ [NSString stringWithFormat:@"%s", yytext] retain]; return IDENTIFIER; }

In Parser.ym:

%{

#import "MessageBlocks.h"

int yylex(void);
void yyerror(char *s);
#define YYSTYPE YYresultType
%}

/*
%union {
float value;
NSString *identifier;
HYPLangNodeNP *node;
}*/

...

and so on.

I'm still getting Objective-C compilation errors, so I'm no further forward than you were, but I'll keep working on it... but probably it won't be useful to you.


* See very last paragraph of this section:

This section has been concerned with explaining the advantages of the four Prologue alternatives over the original Yacc Prologue.

It explains the weakness of the yacc code ordering and how bison overcomes that with the %code directive. It is yacc and not bison that is built in to Xcode. It would be possible to replace yacc with bison on the system to overcome this deficiency.

Xcode Simulator: how to remove older unneeded devices?

Did you try to just delete the 4.3 SDK from within the Xcode Package?

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs

please also delete the corresponding .dmg file in

~/Library/Caches/com.apple.dt.Xcode/Downloads

to prevent Xcode from re-installing the same package again.


for XCode >= 6 see @praveen-matanam 's answer

iOS Xcode 10 Simulator Error (OSStatus error -600)

Restart the computer (not just Xcode). Then go into Library / Developer / CoreSimulator / Devices and throw everything in the trash. Then launch Xcode, go into Devices and Simulators, and delete all simulators from the Simulators pane. Now create one simulator in the Simulators pane. You will be able to build and run on it.

EDIT The OP reports that even this was insufficient to clean out the problematic dead simulators. It was also necessary to say xcrun simctl delete unavailable in the Terminal.

128 character limit in UI test Xcode

You can use label LIKE for your full string:

let yourSuperLongText = "your super long string"
let predicate = NSPredicate(format: "label LIKE %@", yourSuperLongText)
let element = tablesQuery.children(matching: .cell).element(boundBy: 0).staticTexts.element(matching: predicate)

XCTAssert(element.exists)

Or you can use label CONTAINS for part of your string:

 let partOfYoursSuperLongText = "part of your super long string"
let predicate = NSPredicate(format: "label CONTAINS[c] %@", partOfYoursSuperLongText)
let element = tablesQuery.children(matching: .cell).element(boundBy: 0).staticTexts.element(matching: predicate)

XCTAssert(element.exists)

More here:
How to test that staticTexts contains a string using XCTest

and here: https://developer.apple.com/documentation/foundation/nspredicate



Related Topics



Leave a reply



Submit