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.

objective c - Class instances differ, which one to use? -


i'm stuck following. in program, i'm trying communicate between different classes (view controllers nib files attached in tabbar application etc). want call method 'omfg' in class called 'productviewdetailcontroller'. class uiviewcontroller (splitviewdelegate). it's loaded programmatically.

anyways, i've been trying right call controller, , came 2 solutions. 1 declaring productviewdetailcontroller in caller's .h file , .m file, making iboutlet, linking in interface builder , calling directly line

[productdetailcontroller omfg]; 

when call method, calls right method in productviewdetailcontroller, instance of viewcontroller differs 1 programmatically can reach code:

for (uiviewcontroller *controller in self.tabbarcontroller.viewcontrollers) {       nslog(@"%@", [controller class]);       if ([controller iskindofclass:[uisplitviewcontroller class]]) {        uisplitviewcontroller *cell = (uisplitviewcontroller *)controller;        (uiviewcontroller *controller2 in cell.viewcontrollers) {         nslog(@"%@", [controller2 class]);         if ([controller2 iskindofclass:[productviewdetailcontroller class]]) {          [controller2 omfg];          }        }       } 

which 1 should use, , why?

edit: when try add subview both viewcontrollers, 1 call [controller2 omfg]; shows newly added view, [productdetailcontroller omfg]; doesn't show newly added view... why that? there shorter (and more chique) way access right viewcontroller?

you should use iboutlet. makes sure app can still call correct target if later decide change hierarchy of view controllers, example if creating iphone compatible setup without uisplitviewcontroller.

calling iskindofclass: in objective-c sure sign doing wrong. firstly in cocoa touch what do more important who are. secondly try peeking inside should left private.


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 -