-1

I am working on an app with a splitview controller and support for all orientations. But a button I added onto the detailview is not working when in landscape mode so I wondered how one can find out what the current delegate is, so that I can send a command for the action there.

Update

Basically the button(in the detailVC) is supposed to change the VC in the masterVC? Maybe not basic but it shouldn't be crazy difficult to do?

AMAN77
  • 6,218
  • 9
  • 45
  • 60
  • http://stackoverflow.com/a/5183349/1083921 This will give you the actions and targets of your button. – Marc Sep 04 '14 at 12:16
  • possible duplicate of [How to get UIButton Target, Action and Control events?](http://stackoverflow.com/questions/5182860/how-to-get-uibutton-target-action-and-control-events) – Alex Sep 05 '14 at 10:19
  • No see this is inherited code where the delgates and View Controllers have been split up and I am never sure how to find out which is which so I am looking for a way to find(log) the delegate as it is a highly complex app with a lot of different commands going off at any one time. – AMAN77 Sep 08 '14 at 07:29

1 Answers1

0

If your asking for orientation case then

UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

if(orientation == 0) //Default orientation 
  //UI is in Default (Portrait) -- this is really a just a failsafe. 
else if(orientation == UIInterfaceOrientationPortrait)
  //Do something if the orientation is in Portrait
else if(orientation == UIInterfaceOrientationLandscapeLeft)
  // Do something if Left
else if(orientation == UIInterfaceOrientationLandscapeRight)
  //Do something if right

Else case , I would like to know more about your question in detail(what exact delegate your looking for)

nikhil84
  • 3,235
  • 4
  • 22
  • 43
  • Well I'm trying to find out the name of the delegate as I want to add a method to it but there are a whole bunch so I wondered if there was a way to log it? – AMAN77 Sep 04 '14 at 11:03
  • So this way you will get the orientation and depending on orientation you could program your operation(of your button in detail VC). – nikhil84 Sep 04 '14 at 12:21
  • Yes I have something like this running in the AppDelegate, but thanks for trying. – AMAN77 Sep 04 '14 at 13:57
  • So did you found solution to it? or was my info useful? – nikhil84 Sep 05 '14 at 04:39
  • I found a solution to my problem but not too my question, and no unfortunately your info was not useful/relevant to either. I assume english is not your first language, but thank-you for trying bud. – AMAN77 Sep 05 '14 at 09:52