Updated iOS binary not updating MainView NIB - ios

So I'm about to update my app and I have ran into a problem. On my main screen I have a series of UIButtons that lead to different views. I created the UIButtons using Interface Builder.
In my latest update, I want to disable the buttons until the appropriate data is downloaded from the server. For some strange reason, any changes I make to the NIB in Interface Builder are not working. For example, I disable a button in IB, but it will still be active when I Build & Run. It's like it's using the NIB from the previous version still. I've tried deleting buttons from the NIB, but they still show up in the simulator or device. The only way I have found to fix it, although not ideal, is to delete the entire app of the device or simulator and install a fresh copy. But my users are probably not going to do that. They'll simply download the update from the App Store.
I've also tried Cleaning before Running, that didn't work either.
Any thoughts??? Is this an Interface Builder bug??
EDIT: I suppose I could rename the nib and force the update to load the new version of itself.
UPDATE: Renaming the Main NIB file worked forcing the device/simulator to update the file. I truly think this is a bug somewhere. My code may be sloppy at times, but I know how to enable/disable buttons.

This isn't your fault. This is a deficiency in how Xcode (more than a year after the question above was asked) installs resources in an app folder, either to the simulator or a device, prior to running. It copies new or changed resources (which is great, because it shortens install time) but it does not delete obsolete ones. This behavior bit me when I was moving away from using .xib files in some of my view controllers - I actually deleted them from the project, but the view controllers kept loading them anyway, which was mystifying and disturbing until I figured out what was going on.
Deleting the app from the simulator or device prior to installing will, perforce, remove the old resources as well, and the next install will have only the resources specified in your build.
I'm still working on a solution; if I think of it, I'll update this answer if and when I come up with something.
This problem does not occur when installing from the App Store or from an .ipa file - it appears that this install process does a clean reinstall of resources.

Related

What is the simplest way to copy project folder to new Mac with updated IOS and Xcode?

I recently acquired a newer MacBook to run the most recent iOS and Xcode versions. I copied a project folder to the new Mac and opened it with Xcode 11.4 (was 10.1 on old Mac). I get 14 errors all related to "Failed to render and update auto layout status for ..VeiwController". The simulator runs fine, but the main storyboard doesn't render the button icons properly. I can add new constraints to the buttons to show them properly but the errors don't go away. I assume I have lost some info/files related to autolayout when I copied folders. I have read about similar issues. Most talk about using Github or some other 3rd party for maintaining files. Is there any other way to get this done? It seems like updates computers/software should be simpler.
Since reporting this, I have used the same process of copying folders of all other projects and have had no problems. But one project, the largest and most complex continues to have 14 rendering errors and always the displayed err message "An internal error occurred. Editing functionality may be limited." The strange thing is going in and out of viewing Main.storyboard several times gets rid of the errors eventually. Unfortunately, the errors always come back when I open the project. And sometimes they go away, then come back randomly in the same session.
So the answer to "whats the simplest way to copy a project folder to new computer is just that - Copy the project folder! But thats the wrong question for this problem.

Why is my storyboard not working properly?

I am building an app right now and using storyboards for the user interface. Storyboards were working great until about a week ago. Suddenly, they began to give me trouble. I posted a couple of Stack Overflow question regarding issues about storyboards. I have been experiencing all of the following issues:
Actions connect as AnyObject instead of Any when connecting them from storyboard.
I receive an error unrecognized selector sent to instance 0x7fb80e92bc00 due to objects not connecting from storyboard to source code.
Unwind Segues do not work. When I try to connect one, it doesn't even show any available.
I cannot select any of my UIViewControllers from the dropdown menu under the Identity inspector which I discussed more about in this question.
Inherit module from target does not get automatically selected in Interface Builder.
Here are the following things I have tried:
Clean the build folder.
Restart Xcode.
Restart my MacBook.
Delete derived data.
Tried a different storyboard.
Deleted some of the files that were giving me trouble (which is no longer an option as all files are giving me trouble).
New issues pop up everyday and it is getting more difficult to build my app when these issues occur. Why is this happening and is there any solution available?
I am facing the same issue in Xcode beta version. It generally facing when create new file. I resolved by following steps
Remove File reference
Add file again. (If file add with "copy" suffix, delete original file from source folder remove "copy" from file name)
Now try to connect with your reference, it will work

My image assets fail to load for a nib in my iOS app

My image assets fail to load for a nib in my iOS app, but I have added them with interface builder's dropdown that lists my files.
I get an error message saying that it failed to load "Foo.png", but I can see this in my bundle, and Interface Builder populates its drop down selection box for the image with "Foo.png" as well.
Foo.png is in a subfolder in the bundle called "Textures"
Xcode seems to go out of its way to hide paths and stop you from needing to specify them fully. However, this can cause confusion for both the developer and the tools themselves.
Specifically, in Interface Builder you need to fully qualify the path relative to the bundle root. If you do not do this then the asset will fail to load along with any #2x, #3x versions of it you may have placed next to it. This means that Interface Builder will show you a broken image when you specify the path correctly, however the image will show on device and in the simulator when running the app.
This bug has been present in all versions of Xcode I have used from 3.x through to 6.2. Hopefully it is fixed in a future version. I believe I have reported these long ago, I would highly recommend every developer who uses these features to report these bugs to Apple too.
Note that due to another long standing set of Xcode bugs it is necessary to delete the bundle from the device and do a clean build to ensure that this change has any effect when running the app to test if it fixes the issue.

Xcode stalls on "loading" when trying to create new project

Xcode 6 never gets past "Loading" when I try to create a new project. I actually was able to create a new project yesterday, but I decided to just ditch it completely (deleted). Clearly there must be a bad file somewhere, possibly related to the project I deleted, since I also see the same stalling behavior now with Xcode 5.1, which has worked fine for creating new projects in the past. Xcode 6 has worked fine when starting with an already existing project and still appears to do so. I did not see this exact problem in your data base, though one person saw the project creation freeze before reaching the stage I get to. Their solution was to delete Xcode and every possible file related to it, which I'm a little squeamish about, since I don't want to affect existing projects, and don't have an understanding of what the various files are for.
Deleting the DerivedData of Xcode should fix the issue. You can do this by heading to ~/Library/Developer/XCode/DerivedData (with a Finder window open press cmd+G) and deleting all the subfolders of it.
This is embarrassing, but if it could happen to me, maybe it could happen to someone else. The problem was that the window that came up after the second step in defining the type of project to be created, the one in which you choose where to save the project's files, extended off the bottom of the screen, so that only the very tops of the buttons were visible. Eventually, I realized the one to the far right might be the one to click to continue. Which it was. Feel free to delete this question.

Error Starting MyApplication: Can't find entry point

I was successfully created a signed Blackberry app. I have ever deployed it and succeed. But i wonder why somehow, when now i debug it, the app won't run and said,
Error Starting `MyApplication`: Can't find entry point
During debugging, my project doesn't show any errors, packaging works well. As far as i remember, i do not perform any significant changes on my code nor on the project description and properties, before i got this error. Anyone here ever faced the same problem?
For your info, my project has only one main method and uses SMS listener thread inside UiApplication class. I get this error both on real device and simulator. I was trying to completely uninstall the app, but coincidentally it cannot be deleted because delete menu doesn't appear.
First of all, make sure that the main method is in a publicly accessible Class, and add a breakpoint to the first line inside the method, to check that the application isn't throwing an exception and dying on your. Also try putting the whole main method into a try/catch with exception logging to get a look at what might/might not be going on.
Secondly, it is possible that the device/simulator being used just needs the previous version of the application deleting. Go to the settings and navigate to the third party installed apps, and make sure yours is removed. A reboot is required (battery pull). On simulator, navigate to the bin/simulator folder in your SDK directory and run the cleanup.bat file to reset the simulator. Then try again. You say that the delete menu doesn't appear, I assume this is on the Third party Installs screen?
A third option is to go into your application descriptor xml file, and check that there is a visible entry point, and that everything is correctly filled in.
Also try doing a refresh and clean build, and checking that all the files are correctly compiling (is there a class file created correctly in your bin folder? And has the distribution folder correctly populated with the cod/jad files for distribution?)
Another option is to re-import the project into your IDE to force the IDE to regenerate some files, and to try loading another project onto the device. If that works an option could be to copy your class files etc over to the new project.
Some of the above are a hassle, but welcome to BlackBerry development!

Resources