Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

iphone - Very basic objective-c question-how do I make different views share information? -


so, basically, have 4 different views switched via tab bar @ bottom of screen. have view controller set each one, , work fine. problem have no idea how share information between different views-for example, have ibaction on 1 takes output of uisegmentedcontrol , stores selection integer (1,2,3,4). problem is, don't know how access integer first view controller (the 1 stuff information). i'm sure basic problem google-fu doesn't seem working here. thanks!

using mvc method, information should not stored in view controllers. should have separate object stores information, view controllers load it, , views display it. easiest way store information in application's delegate. then, whenever view controller needs find/change information, can use [[uiapplication sharedapplication] delegate] delegate, , load/change information needed. load information update display in viewdidload or viewwilldisplay:, , change in action methods.

edit example:

delegateclass.h

@interface delegateclass : nsobject {     //ivars     float number1; } @property (assign) float number1; ... @end 

delegateclass.m

#import "delegateclass.h" @implementation delegateclass @synthesize number1; ... @end 

myviewcontroller.m

#import "delegateclass.h" @implementation myviewcontroller - (void)viewdidload {     [super viewdidload];     delegateclass *delegate = [[uiapplication sharedapplication] delegate];     float number1 = delegate.number1;     ... } - (ibaction)actionmethod:(id)sender {     float number1 = sender.floatvalue;//get new value     ((delegateclass*)[[uiapplication sharedapplication] delegate]).number1 = number1; } ... @end 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -