I've tried to figure out how to add the icon of app and launch image following this guide (https://doc.qt.io/qt-5/ios-platform-notes.html#launch-images), but without any success.
I do not understand several, maybe the simplest, moments:
1) Where should the folder "ios" with Info.plist file be located? In root folder of project or in "Resource" folder? A little example or screenshot would be useful.
2) Can I change Info.plist directly in .pro-file before it will be generated by Qt? Or it is necessary to compose Info.plist manually and locate it in pre-created "ios"-folder?
3) Maybe, there is another way to set the launch image and app icon? Without touching .pro-file.
Will be glad of any help. Thank in advance.
By your questions:
This folder you may create manually and then put default Info.plist into.
Also you could edit default Info.plist in Xcode and the put them into ios folder (or other).
Follow the https://doc.qt.io/qt-5/ios-platform-notes.html#information-property-list-files you need add this code to your pro-file (instead Qt Creator will replace Info.plist):
ios {
QMAKE_INFO_PLIST = ios/Info.plist
}
Yes you can.
More of that - no best-practices-way to edit it maximally right by Qt tools. In first answer I wrote that you may edit default Info.plist in Xcode directly. (but don't forget copy it in your Qt-project)
To change app-icon of launch images no need to edit .pro file. You need to edit Info.plist generally.
You can do it in Xcode directly. But you need to do it every time after you make changes in your qt-project. I don't think that is correct way.
I answered to your several, simples questions. Hope thats helps!
I am having an issue where the code associated with some of my View Controllers is not showing up in the Assistant Editor window to the right of the Storyboard. It says "No Assistant Results" where the swift code should be.
Things I have tried (There are many things):
Cleaning project
Deleting DerivedData
Creating new, identical View Controllers to see if the issue was just in those particular views.(the same issue occurred)
Deleting and Reinstalling Xcode
Restarting my Computer.
NOTE: I also am getting a warning at the top of the editor: Internal Error has occurred, source Editor functionality is limited.
Ok, I've had this problem before. I couldn't remember how I solved this so I searched on Google and found this question. But this time, nothing helped me. These are the things I did. I believe the last one solved this.
Clear Derived Data. Go to Terminal and enter this: rm -rf ~/Library/Developer/Xcode/DerivedData
Quit the whole Xcode.
Close all tabs of Xcode and make sure to view some class files instead of Interface builder and go try again viewing assistant results.
Remove the assigned class to the View Controller nib you think causes the problem, then assign the class again. Boom! Solved!
This method worked for me: (Xcode 10.2)
1- Select the broken ViewController on the StoryBoard
2- In Identity Inspector, change the item in Class to another class (any class)
3- Change the Class back to related class
4- Save and close the project
5- Reopen the project
What worked for me was to close Xcode entirely, open again, and then I tried assistant.
Just do a simple close the app and open the app again. It worked for me
Deleting derived data did not work for my problem.
This is how I solved this when I encountered this issue,
Go to the file that contains your class, go to File inspector > Target Membership, and then make sure that there is a check mark in the target of your project.
I hope this solves your issue.
Go to Assistant Mode on the upper right.
Click Command + Shift + T. New window will be opened and close the old one. You will be able to see something. Now go to Top Level Objects and select your file.
Click option+alt and click on the view controller you want to present.
Argh! This annoyance happens to me all the time.
I'm not 100% sure I know what the fix is, however I think I may have just "fixed" this a few seconds ago using the following voodoo:
1) Delete derived Data
2) Close xcode, reopen Xcode. Maybe Wait for indexing to finish?
3) View a source code file (.m,.h, .swift) in the main editor, the assistant editor should now show "Counterparts".
4) Change this to "Manual" rather than "Automatic"
5) Switch back to your nib/storyboard
6) Change back to "Automatic" rather than "Manual"
7) Probably continue pulling hair out :)
Edit
Seems as though maybe only step 3 is required as this happened again just now.
I had this issue and was able to resolve it. I resolved it by viewing the storyboard as source. I then removed everything in and including the tags (Saving it to restore later). I then went back and viewed the storyboard normally and created a new ViewController. Once the new ViewController was on the storyboard the assistant editor acted as normal. I then went back and viewed the storyboard as source code once again and replaced the current tags with the one I removed previously. This resolved my issues hopefully it will help for you.
For me (Xcode 11) it was cause by installing cocoapods, tried all the trick that I could find. Finally this helped me. Go to Xcode File Menu -> WorkSpace Settings -> enable legacy build systems
The same problem happened to me.
I only have to restart Xcode (12.2)
For any one who is encountering the same problem in Xcode version 13.3
Explanation: for me, the reason why it wasn't working is that I created a controller, view, and model Folder and I put the Main.storyboard inside the view folder and the viewController.swift inside the controller view, therefore when I try to access the assistant Result Xcode doesn't know where the viewController file is, so he is not able to connect between the storyboard file and the latter.
Solution: What worked for me is that I simply ran the app and it automatically connected the viewController with the storyboard.
I hope this was helpful.
I don't know if this is still helpful or not, for what is worth, the way I managed to restore this when it's been working perfectly and all of a sudden it stopped is by changing Assistant Editor view-mode.
I usually have it in Assistant Editors at bottom, so just change it to whatever else, such as All Editors Stacked Vertically and go back, and it should be working ok now.
xcode 8.3.2, if it's any use.
I tried various ideas mentioned here but nothing worked for me. So in the Project navigator, I right clicked on the .DS_Store file, clicked on Delete, and then chose "Move to Trash" on the confirmation prompt. After closing Xcode and opening it again, a new .DS_Store file was created. The Assistant Editor is working again and the .h and .m files appear in the Project navigator again. I am using Visual Studio for Mac which communicates with Xcode. Today I had to close and open both Visual Studio and Xcode after deleting the .DS_Store file.
you may have changed the name of the .swift file after you connected your IB oulets and IB actions.
select main.storyboard and select your view controller.
at the far right select identity inspector.
check if the class name is the same name as your .swift file, if it is not you need to put in the file name and the assistant should show up now.
In my case, the class name of File's Owner is incorrect (the class doesn't exist). I corrected the class name and it works again
Go to the view controller Identity Inspector (see the image). Change your controller to something incorrect, then change it back.
I had the same problem and I realized that selecting the Outlets option in the top of the Assistant Editor View solves the problem.
In addition to this, I found that if your classes are in several groups for some reason Xcode losses the reference to the class.
I setup the folder for the derived data when I installed Xcode in a folder I deleted cleaning my disk! So I created a new folder and I assigned in locations as above. Thats it! I was cleaning a file that didn't exist.
If the problem started after renaming the ViewController, first check whether you've changed the class name inside the ViewController file as well.
I have disabled xcode indexing, so after enabling indexing it starts working
Faced same issue.
For me it happen when I moved my view controllers to the new group.
The solution was unfortunate, but at least it worked again - I just moved the files back to the origin folder.
In Xcode 12.x, this will happen if you rename your ViewController file after creating it. If this is the case, just simply delete that ViewController file, and create a new one with a file name that you will not change, and then the Assistant window should automatically populate.
Please make sure that there is
no error in your project and your project is complining succesfully.
In my case, there was an error om some other class due to which I was not able to see assistant results.
After 7 imaginary hours, I finally found the answer. this is only for the storyboard for other people out there reading this is the answer if it does not help I don't care but here it is.
(This is an example project I cloned from GitHub)
Just select veiwcontroller.swift in the document outline, it should work.
Here is a screenshot.
Like i told, example project.
Had the same problem on Xcode Version 13.0 (13A233). As Glenn Posadas mentioned, deleting the derived data rm -rf ~/Library/Developer/Xcode/DerivedData then closing and re-opening the project solved the problem for me.
I had the same problem, so I re-organized files in folders and it got fixed. If you have the file in a specific folder, please put it outside that folder.
Try this (XCode 13.2.1):
In Storyboard, select the object whose class definition you want to
bring up in the assistant editor.
Delete the custom class in the Identity Inspector, being sure to
press the return key to lock in the change.
Quit XCode and reopen.
Re-enter your custom class name in the Identity Inspector.
I tried all the suggestions above and this was the only thing that worked for me.
Xcode 13.3.1
None of these worked but I did a clean and shut everything down and reopened and it worked.
One reason for this happening is moving the swift file to a different folder. If I move the swift file out of the folder, the assistant view works again. If I move the swift file back into a folder, it fails again.
After trying several tricks mentioned here, this seems to have finally worked for me:
Close the project,
Rename the project folder in Finder (i.e. the folder containing the .xcodeproj file)
Double click the .xcodeproj file to open the project.
It seems that paths stored in local cache files can be stubborn about being updated.
After I upgraded to Xcode 6.1, it kept throwing this exception when I tried to build my existing application. I tried to remove 'MyController' and add back again. But it would throw the same exception with different controller.
could not read data from '/Users/macbookpro/Library/Developer/Xcode/DerivedData/MyApp-
dmhwkhbfbxprhycwjeunwtbbtsxj/Build/Intermediates/MyApp.build/DEV-iphoneos/MyApp.build/MyController-
PartialInfo.plist': The file “MyController-PartialInfo.plist” couldn’t be opened because there is no
such file.
I found the answer. I have to replace all xib files' IBCocoaTouchPlugin to newer version.
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
You can solve it by deleting the content in the DerivedData folder. If you're worried about deleting too many folders, then delete only the folders that start with the name of your current project that you're trying to problem-solve for.
Remember to close XCode before you delete the data
Library/Developer/Xcode/DerivedData/
For me (with Xcode 6.3) this was happening with a file that happened to end in ~iPhone.xib. I changed it end in the all lower-case ~iphone.xib, and problem solved.
This is generally happens when you open old version xibs
nothing to do only click on the xib in file panel its version will automatically changed/updated with newer version.
so also you not need to remember it.
I encountered this problem when I moved my .plist file to a new folder. You have to go into the Targets list (select the top bar on the left vertical menu of Xcode, the one that has the name of your project, and then select Targets on the vertical menu second from the left) and find the Identity section. From there, select the button that lets you specify the new path of the .plist file.
If that doesn't work, then try deleting your project's folder in ~/Library/Developer/Xcode/DerivedData/ and building again.
Several of you have come up with the partial answer.
I believe this issue is related to Apple's "fix" for when XIBs were loading slowly when they referenced custom fonts. They now store the custom font info in a xibnamePartialInfo.plist file in your derivedData folder.
Now if your app contains xibname~iPhone.xib AND xibname.xib, only the PartialInfo.plist file for xibname~iPhone.xib gets created and you see the error. Opening the xib in InterfaceBuilder had the side-effect of creating this file which is why the problem appeared to go away (until the next clean).
So the solution is to rename all ~iPhone files to something else (dash works as a replacement for tilde). Apparently its the tilde that is hindering the creation of the PartialInfo.plist file for the root XIB
Common answer for most of question... Restart Xcode. It works for me.
Im getting this explanation when my app is rejected by Apple:
Invalid File Name - Your package contains a file 'XXXX.app/en.lproj/MainStoryboard.storyboardc/.nib' with a name that contains invalid characters. Avoid using control characters in the file names. Also avoid leading or trailing whitespace characters in the file names.
What is this .nib file and how do i resolve this error?
I did cd into the MainStoryboard.storyboardc folder and there was a file ?.nib, but when i press cat <tab> i have to type ^V.nib.
I can confirm that #PPCC's answer worked. I had some trouble finding the folder though so I want to share that here. The easiest I think to find it is to go to the derived data for your project. In Xcode, go to Window->Projects and then you can see where the derived data resides for your project.
So my .nib file was located in /Build/Products/Debug-iphoneos/.app/.storyboardc
There I found a file with name "??.nib". I used the "cat" command to open it in command line and then scanned the information in there for the viewcontroller that the .nib file belonged to. I then deleted that viewcontroller from the storyboard and created it again. I made sure to specify a storyboard id. Then I cleaned the project and rebuilt it. It didn't create that .nib file again and I had no problems afterward.
Hope this helps someone.
I ended up rebuilding my entire story-board. Thankfully i had my classes intact so it only took about 15 minutes
I had the same problem and I didn't want to remake all the storyboard file again because it was very hard.
Finally I solved it like below:
The problem was there was a file named ".nib" inside a directory that is automatically created "myAppName.app/MainStoryboard_iPhone.storyboardc".
It's supposed that, when compiling the app, this directory is automatically created and inside there, a lot of files are created related to all the views included inside my storyboard.
The file ".nib" is difficult to find because the MacOs thinks it's a hidden file because it starts with a point.
After being able to open the .nib file I saw it was like an xml file and I recognized the storyboard identifier of one of my views that where on my storyboard.
After that I delete the .nib file and I delete the view inside my storyboard as well. After re-compiling the app the file .nib wasn't created.
So, I added another view to my storyboard and re-designed it like it previously was, and put the same storyboard identifier as well. Only one view.
After that the app compiled well, the .nib file wasn't created, and the app has passed the Apple first revision (now it's waiting for review).
So, there's a bug, maybe in XCode, that creates a .nib file of some storyboard views by error.
I hope this could help in the future if someone has the same problem.
I believe I might have solved mine by removing 'compile with bitcode' option. Further testing required
As an addition to all the other answers: In my case there was a 'storyboardIdentifier' in the storyboard file with a newline. Removing this identifier fixed the problem.