I have just upgraded to Xcode 13.1 and both the Target and Storyboard displays XML only.
This is my project Target file view.
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objects = {
/* Begin PBXBuildFile section */
FE02B2A625CB5E7D00C2B123 /* SectorTime.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE02B2A525CB5E7D00C2B123 /* SectorTime.swift */; };
FE0340BC2169997900803E4C /* TransactionNumberGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0340BB2169997900803E4C /* TransactionNumberGenerator.swift */; };
FE036EF7245D116000C9D3A1 /* ArchiveImport.swift in Sources */ = {isa = PBXBuildFile;
The "Open As" options are missing from the menu when I right click on the storyboard file in the project navigator:
Anyone have any ideas? I have done a clean build and I restarted both Xcode and my Mac.
Thanks, I did find the problem. The editor remained in "Code Review" mode after the automatic upgrade to Xcode 13.1. By pressing "Disable Code Review" in the top right-hand corner, I fixed everything.
It was not an obvious fix because the Code Review mode remained on across different files I selected. Also, because my source code was up to date, there were no differences in my Swift code files, so they all looked original, whereas Storyboard and Targets seemed quite different.
Related
I'm building an app with RAD Studio 11, but I can't find a way to change the item font of my TListBox.
I tried to change TListBox.Font in the Object Inspector, but when I select my TListBox called ingredientsDataBase in the Object Inspector, I can just change TListBox settings instead of TListBox.Items settings.
I add a TListBoxItem manually as follow:
Then, I can change ListBoxItem1.Font in the Object Inspector, after selecting my ListBoxItem1 (no problem).
The problem is that, when I run my program, the Font change only affects my ListBoxItem1, and I want the same Font for every item that I add to my TListBox.
UPDATE 1
After your help I tried to convert your Delphi code to C++.
__fastcall TIngredientCreator::addButtonClick(TObject *Sender){
//More code Here
//Then I ADD a new ListBoxItem to my ListBox "ingredientsDataBase"
ingredientsDataBase->Items->Add("newIngredient");
TListBoxItem *lbItem = new TListBoxItem(ingredientsDataBase);
lbItem->Parent = ingredientsDataBase;
// Remove Family and Size from the items TStyledSettings
lbItem->StyledSettings = lbItem->StyledSettings << TStyledSetting::Family << TStyledSetting::Size;
// You can now set these TextSettings as needed
lbItem->TextSettings->Font->Family = "Algerian";
lbItem->TextSettings->Font->Size = 18;
lbItem->Text = "algerian";
delete lbItem;
}
There is no syntax error, but I can't associate my new ListBoxItem, in this case the Text or Name of that new ListBoxItem called "newIngredient" (I don't know how to do it in this code), so when I run my program nothing happen to mi new Item at least.
UPDATE 2
I found a way to associate my newIngredient to TListBoxItem Object as follow:
int index = ingredientsDataBase->Items->IndexOf(newIngredient);
lbItem = ingredientsDataBase->ItemByIndex(index);
When I run the code and I add a new Ingredient, just the Text of the newIngredient is changed to "algerian", because in the first code I have this line lbItem->Text = "algerian" all good here. But Font and Size still without change.
Thanks for your answers
When you add items to the listbox, you need to clear some items from the default StyledSettings property of the new item, if you want to modify the corresponding TextSettings.
Here's an example in Delphi to do what you want:
procedure TForm5.Button2Click(Sender: TObject);
var
lbItem: TListBoxItem;
begin
lbItem := TListBoxItem.Create(ListBox1);
lbItem.Parent := ListBox1;
// Remove Family and Size from the items TStyledSettings
lbItem.StyledSettings := lbItem.StyledSettings - [TStyledSetting.Family,TStyledSetting.Size];
// You can now set these TextSettings as needed
lbItem.TextSettings.Font.Family := 'Algerian';
lbItem.TextSettings.Font.Size := 18;
lbItem.Text := 'algerian';
// In Embarcadero C++Builder you use the ">>" operator to remove members from a set, and "<<" to include them.
end;
After your help my code in a Multi-Device Application C++ Builder project result on the next code:
__fastcall TIngredientCreator::addButtonClick(TObject *Sender){
//More code Here
//Then I ADD a new ListBoxItem to my ListBox "ingredientsDataBase"
ingredientsDataBase->Items->Add("newIngredient");
int index = ingredientsDataBase->Items->IndexOf(newIngredient);
lbItem = ingredientsDataBase->ItemByIndex(index);
// Remove Family and Size from the items TStyledSettings
lbItem->StyledSettings = lbItem->StyledSettings >> TStyledSetting::Family >> TStyledSetting::Size;
// You can now set these TextSettings as needed
lbItem->TextSettings->Font->Family = "Consolas";
lbItem->TextSettings->Font->Size = 18;
delete lbItem;
}
If you are trying to do it in a Windows VCL Aplication C++ Builder Project is easier (You can change the font of the entire TListBox once):
ingredientsDataBase->Font->Size = 8.5;
ingredientsDataBase->Font->Name = "Consolas";
ExtJs 6.2.0 does not work on Firefox if the screen is touch enabled. I noticed the problem using the classic version of the framework, I cannot tell if the modern version is also affected.
This is the exact problem: If the screen is touch enabled, it is possible to use the application with gestures, but not with the mouse. The mouse click does not fire the click events.
There is a mention of this problem on Sencha forum, but what is very frustrating is that Sencha fixes the problem for subscribers, but does not release a new GPL version. There is also a code snippet, but it was not quite clear to me how to use it:
// Undo sencha's logic
// Needed for top nav buttons to not open links in new tabs/windows when clicked in IE11 EXTJS-13775
// Firefox 52 is getting deteceted now as ALWAYS having pointer events
// chromeOS causing issues too
// unit tests failing
if (Ext.isIE || Ext.isEdge || (Ext.firefoxVersion >= 52) || Ext.os.is.ChromeOS || window.inUnitTest) {
// sorry windows mobile phones...
var eventMap = Ext.dom.Element.prototype.eventMap;
eventMap.click = 'click';
eventMap.dblclick = 'dblclick';
}
After some trial and error, and comparing console.logs and rifling in the code, I came up with an override that fixes the bug.
/**
* workaround for bug in ExtJs 6.2.0.
* Resolved in current yet unreleased version
*/
Ext.define('Mb.override.dom.Element', {
override: 'Ext.dom.Element'
},
function(){
var additiveEvents = this.prototype.additiveEvents,
eventMap = this.prototype.eventMap;
if(Ext.supports.TouchEvents && Ext.firefoxVersion >= 52 && Ext.os.is.Desktop){
eventMap['touchstart'] = 'mousedown';
eventMap['touchmove'] = 'mousemove';
eventMap['touchend'] = 'mouseup';
eventMap['touchcancel'] = 'mouseup';
eventMap['click'] = 'click';
eventMap['dblclick'] = 'dblclick';
additiveEvents['mousedown'] = 'mousedown';
additiveEvents['mousemove'] = 'mousemove';
additiveEvents['mouseup'] = 'mouseup';
additiveEvents['touchstart'] = 'touchstart';
additiveEvents['touchmove'] = 'touchmove';
additiveEvents['touchend'] = 'touchend';
additiveEvents['touchcancel'] = 'touchcancel';
additiveEvents['pointerdown'] = 'mousedown';
additiveEvents['pointermove'] = 'mousemove';
additiveEvents['pointerup'] = 'mouseup';
additiveEvents['pointercancel'] = 'mouseup';
}
})
I didn't test if every event translation combination is working. The lines needed especially for click event fired by the mouse with a touchscreen are
eventMap['click'] = 'click';
eventMap['dblclick'] = 'dblclick';
It's a known issue. See our site compatibility note for details:
https://www.fxsitecompat.com/en-CA/docs/2016/touch-event-support-has-been-re-enabled-on-windows-desktop/
I am using xcode 7 , swift 2.0
I am getting voice text to Speech working in Simulator but not in real iphone6 plus device, iOS 9. I have properly imported AVFOUNDATION and its Framework.
I tried...
#IBAction func SpeakTheList(sender: AnyObject) {
let mySpeechUtterance = AVSpeechUtterance(string: speakString)
//let voice = AVSpeechSynthesisVoice(language: "en-US")
// mySpeechUtterance.voice = voice
let voices = AVSpeechSynthesisVoice.speechVoices()
for voice in voices {
if "en-US" == voice.language {
mySpeechUtterance.voice = voice
print(voice.language)
break;
}
}
mySpeechSynthesizer.speakUtterance(mySpeechUtterance)
}
I get the following error :
Building MacinTalk voice for asset: (null)
Is there anything I ned to do settings in my iphone6plus iOS 9 , or I have to download something.
I have found a suggestion here Why I'm getting "Building MacinTalk voice for asset: (null)" in iOS device test
saying that..
" since iOS9, possibly a log event turned on during development that they forgot to turn off"
Just want to add to this (and by extension, the linked discussion in the original post):
I have two devices: an iPad2 and an iPad Air. They are running exactly the same version of iOS (9.2, 13C75). I have the following objective-C++ function for generating speech from Qt using Xcode 7.2 (7C68) on Yosemite:
void iOSTTSClient::speakSpeedGender(const QString &msg, const float speechRateModifier, const QString &gender, const bool cutOff) {
QString noHTML(msg);
noHTML.remove(QRegularExpression("<[^<]*?>"));
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:noHTML.toNSString()];
/* See https://forums.developer.apple.com/thread/18178 */
const float baseSpeechRate = (m_iOSVersion < 9.0) ? 0.15 : AVSpeechUtteranceDefaultSpeechRate;
utterance.rate = baseSpeechRate * speechRateModifier;
NSString *locale;
if (gender.compare("male", Qt::CaseInsensitive) == 0)
locale = #"en-GB"; // "Daniel" by default
else if (gender.compare("female", Qt::CaseInsensitive) == 0)
locale = #"en-US"; // "Samantha" by default
else
locale = [AVSpeechSynthesisVoice currentLanguageCode];
AVSpeechSynthesisVoice *voice = [AVSpeechSynthesisVoice voiceWithLanguage:locale];
const QString errMsg = QString("Null pointer to AVSpeechSynthesisVoice (could not fetch voice for locale '%1')!").arg(QString::fromNSString(locale));
Q_ASSERT_X(voice, "speakSpeedGender", errMsg.toLatin1().data());
utterance.voice = voice;
static const AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
if (synthesizer.speaking && cutOff) {
const bool stopped = [synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
Q_ASSERT_X(stopped, "speakSpeedGender", "Could not stop previous utterance!");
}
[synthesizer speakUtterance:utterance];
}
On the iPad Air, everything works beautifully:
Building MacinTalk voice for asset:
file:///private/var/mobile/Library/Assets/com_apple_MobileAsset_MacinTalkVoiceAssets/db2bf75d6d3dbf8d4825a3ea16b1a879ac31466b.asset/AssetData/
But on the iPad2, I hear nothing and get the following:
Building MacinTalk voice for asset: (null)
Out of curiosity, I fired up the iPad2 simulator and ran my app there. I got yet another console message:
AXSpeechAssetDownloader|error| ASAssetQuery error fetching results
(for com.apple.MobileAsset.MacinTalkVoiceAssets) Error Domain=ASError
Code=21 "Unable to copy asset information"
UserInfo={NSDescription=Unable to copy asset information}
However, I heard speech! And I realized I was wearing headphones. Sure enough, when I plugged ear buds into the iPad2, I heard speech there too. So now I'm searching for information about that. The following link is recent and has the usual assortment of this-worked-for-me voodoo (none of it helped me, but maybe will help others with this problem):
https://forums.developer.apple.com/thread/18444
In summary: TTS "works" but is not necessarily audible without headphones/ear buds. It appears to be a hardware settings issue with iOS 9.2. The console messages may or may not be relevant.
Final update: in the interests of full, if sheepish, disclosure, I figured I'd share how I finally solved the issue. The iPad2 in question had the "Use side switch to:" option set to "Mute". I left that alone but went ahead and toggled the switch itself. Wham! Everything worked without ear buds. So if you are unable to hear text-to-speech, try ear-buds. If that works, check whether your device is set to mute!
Do not use pauseSpeakingAtBoundary(). Instead, use stopSpeakingAtBoundary and continueSpeaking. This works for me.
Finally Found that there was a bug in iOS9, soon after XCODE new release 7.2 update, and iOS 9.2 Update release,
I tested same above code, text to speech started working.
What is the difference between PBXBuildFile and PBXFileReference in project.pbxproj? Does it matter if a file is listed in both of the sections? What is the policy what file in which section should get?
/* Begin PBXBuildFile section */
3D081B83146ACE36000CC86B /* B767.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D081B82146ACE36000CC86B /* B767.png */; };
/* Begin PBXFileReference section */
3D081B82146ACE36000CC86B /* B767.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = B767.png; sourceTree = "<group>"; };
You should normally never have to worry about this, but it can come up in certain merge conflicts in the project.pbxproj file.
A PBXFileReference is a reference to the actual file. It's the object that backs up the files that appear in the left-hand project view.
A PBXBuildFile is a file in a target. It wraps a PBXFileReference and adds certain attributes like per-file compiler flags. If a file is added to a target, it will be listed in both sections. If a file is in more than one target, it will have more than one PBXBuildFile in the build files section.
Is there an easy way to organize the files within the Copy Bundle Resources in xcode 4.0? I have multiple targets for my project, and every time I add files, I need to, most of the time, add them to every project. It would help a great deal if I had an easy way to catch myself when I mistakenly forget to copy resources to every target (other than just looking at the count of files in the bundle, which will eventually diverge from being the same for each project).
It'd be a lot easier if I could make folders within the resources list, but it doesn't seem I can. At the very least it might help if I could automatically alphabetize them.
What you have to do is to parse .pbxproj file. All linked file and resources in .pbxproj are identified from their own UUID. So,
Get the rootObject's UUID
Get list of targets UUID from rootObjects
For each target get the list of UUID for Resource, Source and Framework. And
find the list of files UUID for all of the three resource types
Compare the list of resources for each of the targets.
Some hints,
The format of the project file is like this, the rootObject refer to other objects.
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* .... List of all objects are here .... */
}
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
From the rootObject we can follow the targets value.
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MyProject" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
German,
de,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
targets = (
1D6058900D05DD3D006BFB54 /* TargetDebug */,
C446CDCB12BA35A1001324C8 /* TargetAdHoc */,
C446CF2D12BA3DDC001324C8 /* TargetAppStore */,
);
};
/* End PBXProject section */
In the target section of the project file, buildPhases contains the link to the copied bundle resources list and link.
/* Begin PBXNativeTarget section */
1D6058900D05DD3D006BFB54 /* TargetAdHoc */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TargetAdHoc" */;
buildPhases = (
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = TargetAdHoc;
productName = MyProject;
productReference = 1D6058910D05DD3D006BFB54 /* MyProject.app */;
productType = "com.apple.product-type.application";
};
C446CDCC12BA35A1001324C8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C446CDCD12BA35A1001324C8 /* MainWindow.xib in Resources */,
/* ....... list of all PNGs and XIB files..... */
81CDEBBF13B21B790067A088 /* AnImage.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
(on Xcode 3.2.x): You can alphabetize the files in a phase by selecting the phase, then Edit -> Sort -> By Name.
As far as breaking them up into "folders" -- nothing is stopping you from having multiple Copy phases! You can even give each one a descriptive name.
Don't know if it's helpful in this instance, but in Xcode, when you select a file and Get Info on it (command-I), one of the tabs is "Targets." From there, you can select all the targets you want a file to be a part of. I believe that for non-compiled files, it merely adds the file to the Copy Bundle Resources phase of the selected target(s).
You can have folders in your Resources group. Just drag a real finder folder into xcode and choose 'Create folder references for added folders', and choose all the targets that you want to use.
This will create a dynamic folder reference that will add all files within that folder automatically without you having to add the files individually everytime.