iphone - iPhoneSDK : view is not loading data for the first time but loads it subsequently -


The problem I am trying to load a UIView with multiple data is that the data is not displayed in the first load , But loads it in subsequent clicks. Can you help me figure out the problem.

  First view controller #import & lt; UIKit / UIKit.h & gt; @ Class second view controller; @ Interface firstview controller: UIViewController {IBOletlet II Visual Controller * mySecondViewController; IBOutlet UIImageView * myimage1; IBOutlet UIImageView * myimage2; IBOutlet UILabel * mylabel1; IBOutlet UILb * mylabel2; } @ Property (Nonomatic, Rectangle) IBotlotte II Visual Controller * mySecondViewController; @protecti (nontomic, write) IBOutlet UIImageView * myimage1; @protecti (nanatomic, raten) ibotlet UIImage weave * MyMej2; @property (non-monitored, reserved) IBOutlet UILabel * mylabel1; @protecti (nontomic, raten) IBotlate uilable * milebayle 2; - (IABTION) LearningEXview: (ID) sender; - (IABTION) LearnEXActVV2: (ID) sender; @endFirstViewController M # Imports "FirstviewCenter.H" #import "SecondView Controller. HK" @Employment FirstviewControlor @ SynthesisMaxContViewCentronerMyMage 1MyMailMailMailBel1MailBell2; - (IABTension) LearningSquare (id) Sender {mySecondViewController.name.text = @ "Paul"; MySecondViewController.myimageview.image = [UIImage imageNamed: @ "Paul .png"]; MySecondViewController.statmsg.text = @ "Develop iPhone"; [[Self-Navigation Controller] Push ViewController: MySecondViewController Animated: Yes]; } SecondViewController.m #import "SecondViewController.h" @ Implementation SecondViewController @Sitescase myimageview, name, statmsg - (zero) viewDidload {{auto-setty: @ "description"]; [Super viewedload]; }  

Properties are not coming for the first time but after returning from viewing and then again the views are displayed after loading.

I am loading SecondViewController from FirstViewController.

Hello I have solved this, in fact I was pushing my view controller after setting up the property. And this caused the problem.

Instead of:

  mySecondViewController.name.text = @ "Paul"; MySecondViewController.myimageview.image = [UIImage imageNamed: @ "Paul .png"]; MySecondViewController.statmsg.text = @ "Develop iPhone"; [[Self-Navigation Controller] Push ViewController: MySecondViewController Animated: Yes];  

It should be:

  [[self-navigation controller] pushViewController: mySecondViewController Animated: Yes]; MySecondViewController.name.text = @ "" Paul "; MySecondViewController.myimageview.image = [UIImage imageNamed: @" Paul .png "]; MySecondViewController.statmsg.text = @" Develop iPhone ";  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -