ImageView Segue to SplitView - uisplitviewcontroller

I'm trying to implement this example Basic Security in iOS 5, but instead of performing the segue to a tableView I'm trying to make the segue to a splitViewController. When it tries to make the segue it throws this error if I use replace:
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not find a split view controller ancestor for '', while performing a split view controller replace segue (identifier 'LoginSegue') with destination '''
and if I use modal (like in the tutorial):
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a Split View Controllers modally .'
Any suggestions?

Did you find a fix for this? ... THe splitview controller needs to be the root view controller of the application. You can't transition from a normal view to a splitview controller

I've been able to segue to a split view controller by embedding it in a navigation controller at segueing to it modally in a storyboard.

Hi i Found the way to solve this problem here is the link, it's in japanese just translate it cheesememo.blog39.fc2.com/blog-entry-465.html

Related

Why does my view no longer communicate with its controller since the controller was set manually?

Ever since I manually set my Controllers the corresponding views don't seem to recognise my controllers. None of the view elements are recognised by my controllers and none of my Controller methods are recognised by their views. When I hover over the onaction='#...eventHandler' in my views it says there is no controller specified for the top level element.
However, I have set my Controllers (this is the main Controller and then there is another controller set somewhere else for a pop up window):
FXMLLoader loader = new FXMLLoader(getClass().getResource("foodDiaryView.fxml"));
FoodDiary foodDiary = new FoodDiary();
FoodDiaryController controller = new FoodDiaryController(foodDiary);
loader.setController(controller);
Parent root = loader.load();
primaryStage.setTitle("Food Diary");
primaryStage.setScene(new Scene(root, 720, 480));
primaryStage.show();
When I run the program I get this error:
Exception in Application start method
java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.NullPointerException at sample.FoodDiaryController.initialize(FoodDiaryController.java:72)
Which is coincidentally the first line of code that references an element in the view:
#FXML private TableView<Food> breakfastTable;
And then in initialise (line 72) which caused the NullPointerException:
breakfastTable.setItems(foodDiary.getBreakfastFoods());
Anyone who could possibly allude to why this is happening?
Prerequisites:
I have to manually set my Controllers since I'm not using a no-arg constructor with my Controllers.
I'm using IntelliJ
I might be wrong and I can't check right now, but I remember some issues when using setController and setControllerFactory. I think when you've specified a fx:controller in your FXML then you can't use setController but must use the setControllerFactory or something like that.

Custom button for cocos2d

I was working on creating my custom "Button" class... Im not using CCMenuItems because I need some flexibility in my buttons.
My implementation is the following:
DMenuButton : CCSprite <CCTargetedTouchDelegate>
When created, the button receives a target and selector, and builds an NSInvocation. When touched, the invocation is called. I will use this buttons mainly to go from one layer to another.
The problem is that when going from a layer to the next, and then back to the previous, something strange occurs: either no sprites are loaded into the next view or an EXC_BAD_ACCESS error is thrown.
Can anyone help me with this?
Thanks!
PS: My theory is that it has to do with the NSInvocation and the "dealloc" method.
Am I doing something wrong?

returnedObject property

I'm programming in Flex Builder Burrito for an mobile application.
I'm trying to get a variable from navigator.PopView()
and i found the following site: adobe View and ViewNavigator
On that page is written that you can get to an returnedObject:
The ViewNavigator will save this object internally, and the new view can access it from with the navigator.returnedObject property.
The problem is when I want to acces the returnedObject flash builder doesn't seem to find that even the package isn't found.
I've found my problem on an other site.
There it's plain simple explained.
Do the override public function createReturnObject():Object.
On the page where it needs to be send back.
Then on the popped view, you can acces it by returnedObject.
On same page next lines are
The property is a ViewReturnObject
which contains the object that was
returned
and the context in which the removed view was pushed (See Setting
the View Context).
ViewNavigator.poppedViewReturnedObject
is guaranteed to be set by the time
the new view
receives the add event and will be destroyed after the view receives its
viewActivate
event.
and also a NOTE
Note, the return object is only stored when a view is popped of
the navigation stack
or replaced through the use of the pop and replace navigation
operations (e.g.,
replaceView, popView, etc...). It will be cleared after the new view
receives its
ViewNavigatorEvent.VIEW_ACTIVATE event.
I think should try function to get popuped view poppedViewReturnedObject of ViewNavigator
Its description is also on same page
public function get poppedViewReturnedObject():ViewReturnObject
Hopes that help

Opening a new tab and adding an mxml component to it

Hi
In our flex application we have tabs at the main level and under it we have subview.
e.g
Home / Tasks / Admin etc...
In one condition we have to click on a button and open a new tab, on this tab we have to add an existing mxml component and show it in the tab.
We are using parsley as the framework.
Inside the mxml component test.mxml (that is shown in the tab) i am configuring it with parsley using the tag
Now when i add the instance of this test.mxml i am getting an exception
I am deriving this test.mxml instance using teh parsley context
as
context.getObject(id of component) as DisplayObject and adding it to the tabNavigator...
But i am getting exception when i try to grab an instance of a view using parsley context.
How do i get an instance of a view or component that is configure through parsley using the parslye context.
posting some code
in parsley context mxml file
in mediator class
public class TestMediator {
[Inject(id="testViewID")]
public var testView:TestView;
and then i add this view object to a container....
Also the problem is occuring becuase of the view injection..because i get a parsley excepiton on startup of the application stating that there is some problem in the context.
What exception are you getting? Without this information it's hard to help you out.
Anyways, here are some thoughts:
creating views through the container should not be a problem
note that MXML components can't take constructor arguments, so make sure you don't have any in your object definition
children of the tab navigator should be containers, not just display objects

Why is self.navigationController = nil from a method

For some unknown reason I cannot push a view, I will try to explain the best I can but i have alot of complicated views going on, And it would be a nightmare to explain but say I have the following method.
-(void)showDetailView{
DetailViewController *detailView = [[DetailViewController alloc] initWithNibName:#"DetailViewController" bundle:nil];
[self.navigationController pushViewController:detailView animated:YES];
[detailView release];
}
Which works and would push the detail view onto the stack, this is on my main view and my main thread.
So in the table view i have a cell with a Subview that then takes its view from another view controller. In that view controller I have more subviews, and say when a user clicks a subview a method is called. Which in turn will call this method on the mainView.
So one would believe that then a new view should get pushed. And the code runs, no errors occur but the view is not changed/switched.
I have tried various method of pushing a view inside the view controller that is it called from. and then just calling a method which is directly connected to the navigation controller to push the views.
A few things to add.
1. I have a IBAaction button that pushes a view (that works fine)
2. I assume its because im through so many views but I'm assuming that if you call push view controller it will push whatever view you pass it.
3. I have checked when the method is called from the main view self.navigationcontroller does not = null.
But if the navigation controller is called through the method call it = null.
So is there anyway to restore the null value of a navigation controller?
Im a little confused on why i cant simply call a method to push a view
Thanks
Its ok I have sorted it now
In terms of how i solved accessing the superior superview to my view is
An ID tag to the views superview which is the cell that my subview is in
id CellController = [self.view.superview.superview nextResponder];
[CellController performSelector:#selector(showDetailView:) withObject:Link];
Then calling a method in my cell which then in turn access its superview
id mainController = [self.view.superview.superview nextResponder];
[mainController performSelector:#selector(showDetailView:) withObject:Link];
Which then the main still retains its navigation controller and then in the show detail method in the main passes the link and pushes the new view.
Basically the total superview of a subview can be no higher then wherever it was created. So the subview in my cell could never access and run anything through my mainView properly, i could stuff but it never performed how it should be. So accessing its highest level superview and then getting that to access its superview as the cell is in my main view then I could run methods correctly.
Hope this makes sense only getting my head around it all.
Thanks to -> How does one access a super's view controller?
For the Id tag bit, not used Id in this way so another things learnt
I just had nearly the same problem today. If the navigation bar is hidden when you push a view, you may have a nil navigation controller. I resolve the problem like this :
self.navigationController.navigationBarHidden = NO; // So the navigation controller is not nil
[self.navigationController pushViewController:articleInfoController animated:YES];

Resources