0

I have an app that has a UITextView in it. The user presses a button and the action changes the text on the UITextView. The app is functional and in the AppStore right now, it was built using iOS 4.2.

With out changing anything with the code. When testing a new version of the app building it for iOS 6. the app will not show any text in the UITextView when installed in the simulator or new device. The UITextView is blank...but when using an NSLog it writes to the log that there is text in the UITextView.

I have noticed that if the device had the previous version of the app, which is in the AppStore. And I compile the new version of the app onto that device, the app functions like it is suppose to and the UITextView is updated when the button is pressed.

in my .h file

#import <UIKit/UIKit.h>


@interface TimeSheetViewController : UIViewController <UITextViewDelegate>
{

}

    @property(nonatomic, retain) IBOutlet UITextView *logTextView;

in my .m file

@synthesize logTextView;

    -(IBAction)buttonAction
    {   
        logTextView.text = [NSString stringWithFormat:@"%@ \n New words go here...", logTextView.text];
NSLog(@"%@", logTextView.text);
    }

Even trying to have text set from the UITextView from the Interface Builder fails to show up unless the app is pre-existing when the new version is compiled onto the device

OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
  • Is the color of the text the same as the background of UITextView? If it's printing out correctly to the log then the text exists. – Sam May 15 '13 at 03:45
  • 1
    Did you check connection of UITextView in nib file? – Divyu May 15 '13 at 03:53
  • @Sam the background is blue and the text is black. the issue is weird because if the app is previously installed from the AppStore then building the new version to the iPhone work but if it the app is built onto the iPhone without the app pre-exisiting on the iPhone it doesn't work. – OscarTheGrouch May 15 '13 at 11:42
  • @Divyu I did check that it is still connected. the issue is weird because if the app is previously installed from the AppStore then building the new version to the iPhone work but if it the app is built onto the iPhone without the app pre-exisiting on the iPhone it doesn't work. – OscarTheGrouch May 15 '13 at 11:42
  • It is weird.. there must be something that is going wrong may be you should create a new nib file and reuse the view from previous file.. – Divyu May 15 '13 at 12:18
  • @Divyu I took the last working project (which is the version in the AppStore), used Xcode to validate project settings, changed the deployment OS from 4.2 to 6.1, and changed the base SDK to 6.1. Once I do those things to get it to compile again, it starts showing the weird behavior of if the app is previously installed from the AppStore then building the new version to the iPhone or simulator work but if it the app is built onto the iPhone or simulator without the app pre-exisiting on the iPhone it doesn't work. I'm not even sure where to go or what to change now. – OscarTheGrouch May 16 '13 at 02:55
  • @Oscar try also to run project on 5.0 and then check if it's running fine or not... – Divyu May 16 '13 at 05:56
  • @Divyu I tried running the project as 5.0 and it is still doing it. I then disabled ARC for the .m file and ran then project but it is still doing it. After work today I'm going to try to run it from the AppStore version without validating the project settings. Ill post the results. – OscarTheGrouch May 16 '13 at 12:05
  • Try deleting the label and creating a new one and reestablish the connections. Maybe try a project clean for good measure. – Sam May 16 '13 at 19:49
  • @Sam I tried your suggestions, but that did not work either. I think the only thing left to try is start a new project and import/copy and paste all the files and code into the new project. – OscarTheGrouch May 17 '13 at 03:37

3 Answers3

0

Try using the setText method of the textview.

[logTextView setText:@" New words go here..."];

If it doesnt work, check if you have set the textView as not editable ie user interaction disabled or anything like that in xib file if you have one.

prince
  • 854
  • 2
  • 9
  • 36
  • I tried your suggestion, it didn't work. The UITextView is not editable and User Interaction is enabled. It is not editable because I don't want the user typing directly into the UITextView. the issue is weird because if the app is previously installed from the AppStore then building the new version to the iPhone works but if it the app is built onto the iPhone without the app pre-exisiting from the AppStore on the iPhone it doesn't work. – OscarTheGrouch May 15 '13 at 11:49
0

This is only a half answer or more precisely not a solution... according to

Technical Note TN2285: Testing iOS App Updates

Warning: Do not use Xcode to install or run updates to your app for quality assurance testing.

To make the development cycle faster, Xcode only pushes changed files into the apps it runs, and does not delete files from existing app-bundles. This makes builds significantly faster. But it means that using Xcode to install an app over an older old build can make a "frankenbuild" with legacy files it wouldn't otherwise have. This can cause problems during testing and mask bugs.

Additionally, running with Xcode will mask "watchdog crashes" that can happen if an upgrade takes too long to launch.

I believe what is going on is that, some file is being left behind from the AppStore version when I compile my new version from Xcode onto it....making it work like it is suppose to.

But since the file is missing in the new version compiled from Xcode, any new installs of the app from the unreleased future version of the app are missing that particular file and are not functioning correctly.

I'm not quite sure what the file is, but I intend to look into it more or build a new project and copy and paste the old code into it.

Testing Your App on Many Devices and iOS Versions

OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
0

I was using the following code in the viewDidLoad method:

int fontSizeA = [(sizeLabel.text)intValue];
logTextView2.font=[UIFont fontWithName:@"Arial" size:fontSizeA];

The problem I ran into was that the sizeLabel become disconnected in the Interface Builder and the viewDidLoad method was really using this code...

int fontSizeA = [(@"sizeLabel")intValue];
logTextView2.font=[UIFont fontWithName:@"Arial" size:fontSizeA];

which gave the appearance that there was no text in the UITextView.

OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39