Comments (30)
What is the behaviour when you do this? Although you are using the control to organize your UINavigationControllers, the behaviour of the navigation controllers will not change as a result of being contained within the KLNoteViewContoller.
I would attempt to do it using the method call rather than the accessor. i.e. try
[self.navigationItem setLeftBarButtonItem: nil animated: YES/NO];
from klnoteviewcontroller.
The behaviour - nothing happens. i tried
[self.navigationItem setLeftBarButtonItem: nil animated: YES/NO];
nothing happens.
The problem, that if i set action on button within view:
-(void)DeleteLeftItem:(id)sender {
[self updateUI];
}
and press this button, leftbaritem will be removed, but when i call updateUI in noteviewcontroller delegate, nothing happens.
from klnoteviewcontroller.
Have you put a breakpoint to see if the code is being executed?
On 2013-02-27, at 11:37 AM, Kirill Kunst [email protected] wrote:
The behaviour - nothing happens. i tried
[self.navigationItem setLeftBarButtonItem: nil animated: YES/NO];
nothing happens.The problem, that if i set action on button within view:
-(void)DeleteLeftItem:(id)sender {
[self updateUI];
}
and press this button, leftbaritem will be removed, but when i call updateUI in noteviewcontroller delegate, nothing happens.—
Reply to this email directly or view it on GitHub.
from klnoteviewcontroller.
Ofcause, the code executed, but nothing happens.
from klnoteviewcontroller.
i tried set navbar title in updateUI, but I did not get
from klnoteviewcontroller.
Ah I think I know what is wrong
you need to do
self.navigationController.navigationItem.leftBarButtonItem = nil;
from klnoteviewcontroller.
otherwise check fi self.navigationItem is nil or not to see if you are actually referencing anything
from klnoteviewcontroller.
i tried self.navigationController.navigationItem.leftBarButtonItem = nil;
nothing happens.
and i check self.navigationItem is nill or not - it's not nil.
from klnoteviewcontroller.
Can you try to add 3-4 viewcontrollers to klnoteviewcontroller and update title or right or left bar item when viewcontrollers go to KLControllerCardStateDefault state?
Maybe i do anything wrong.
from klnoteviewcontroller.
tbh this is a navigationcontroller issue not related to the control. As mentioned previously the control just organizes UIViewControllers, what you do with the UIViewControllers/UINavigationControllers is up to you. Try performing the same operation with the UINavigationController outside of the control and see if it works
from klnoteviewcontroller.
Try performing the same operation with the UINavigationController outside of the control and see if it works
I try to change nav item title and rightbaritem from uibutton action and everything is ok.
but when i try to do this in
-(void) noteViewController: (KLNoteViewController_) noteViewController didUpdateControllerCard:(KLControllerCard_)controllerCard toDisplayState:(KLControllerCardState) toState fromDisplayState:(KLControllerCardState) fromState {}, nothing happens,unfortunately
from klnoteviewcontroller.
Try
if (toState == KLControllerCardStateDefault) {
NSIndexPath path = [self indexPathForControllerCard:controllerCard];
TDListViewController viewController = (TDListViewController *)[self noteView:self viewControllerForRowAtIndexPath:path];
viewController.navigationController.navigationItem.leftBarButtonItem= nil;
}
}
from klnoteviewcontroller.
just throwing out ideas... :P
from klnoteviewcontroller.
i tried that :) unfortunately, nothing happens
from klnoteviewcontroller.
try performing [noteView reloadDataAnimated:NO]; after the change
from klnoteviewcontroller.
Using a break poing check if the line :
TDListViewController viewController = (TDListViewController *)[self noteView:self viewControllerForRowAtIndexPath:path];
is actually returning a TDListViewController and not a UINavigationController
from klnoteviewcontroller.
Just a note as well, in the code:
NSIndexPath path = [self indexPathForControllerCard:controllerCard];
TDListViewController viewController = (TDListViewController *)[self noteView:self viewControllerForRowAtIndexPath:path];
viewController.navigationController.navigationItem.leftBarButtonItem= nil;
you need a * after NSIndexPath and TDListViewController
from klnoteviewcontroller.
i understand
from klnoteviewcontroller.
TDListViewController viewController = (TDListViewController *)[self noteView:self viewControllerForRowAtIndexPath:path];
it's return me right TDListViewController with right variables
from klnoteviewcontroller.
try performing [noteView reloadDataAnimated:NO]; after the change
if (toState == KLControllerCardStateDefault) {
NSIndexPath *path = [self indexPathForControllerCard:controllerCard];
TDListViewController *viewController = (TDListViewController *)[self noteView:self viewControllerForRowAtIndexPath:path];
viewController.navigationController.navigationItem.leftBarButtonItem= nil;
viewController.navigationItem.leftBarButtonItem= nil;
[self reloadDataAnimated:NO];
}
if i run this code, i have exception:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[_PFArray objectAtIndex:]: index (2147483647) beyond bounds (2)'
from klnoteviewcontroller.
Note you can also get the uiNavigationController reference by simply doing controllerCard.navigationController
from klnoteviewcontroller.
Maybe the problem in my
-
(UIViewController )noteView:(KLNoteViewController)noteView viewControllerForRowAtIndexPath:(NSIndexPath *)indexPath {
//Initialize a blank uiviewcontroller for display purposes
UIStoryboard st = [UIStoryboard storyboardWithName:[[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"] bundle:[NSBundle mainBundle]];
TDListViewController viewController = [st instantiateViewControllerWithIdentifier:@"ListRootViewController"];
viewController.list = self.listsData[indexPath.row];
//Return the custom view controller
return viewController;
}
from klnoteviewcontroller.
You need to have * after UIStoryboard and TDListViewController. You are initializign a pointer
from klnoteviewcontroller.
Be sure you understand what the * actually means in the context of assignment
from klnoteviewcontroller.
you must be getting warnings for that no?
from klnoteviewcontroller.
I understand, i paste this piece of code from xcode, but in xcode i have * when it's nessesary, but there * are hidden. So strange
from klnoteviewcontroller.
ahhh ok I thought you were just not using them and was wondering how it was even working :P
from klnoteviewcontroller.
If I did not have *, my code won't be compiled
from klnoteviewcontroller.
I try a dirty hack. i add viewController property to KLControllerCard.
@Property (nonatomic, strong) UIViewController* viewController;
And in reloadData add:
UIViewController* viewController = [self noteView:self viewControllerForRowAtIndexPath:[NSIndexPath indexPathForRow:count inSection:0]];
UINavigationController* navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
KLControllerCard* noteContainer = [[KLControllerCard alloc] initWithNoteViewController: self
navigationController: navigationController
index:count];
// i add this line
noteContainer.viewController = viewController;
And now in
-(void) noteViewController: (KLNoteViewController_) noteViewController didUpdateControllerCard:(KLControllerCard_)controllerCard toDisplayState:(KLControllerCardState) toState fromDisplayState:(KLControllerCardState) fromState {
if (toState == KLControllerCardStateDefault) {
[((TDListViewController *)controllerCard.viewController) updateUI];
}
}
from klnoteviewcontroller.
Do you think it looks like a patch to your component? :P
from klnoteviewcontroller.
Related Issues (20)
- Pan gesture only works from the navigation bar HOT 1
- Assigning to self before calling super in KLControllerCard HOT 8
- UITableView height problem HOT 3
- (Feature Request) A function to switch back to note view? (instead doing it physically using gesture on the navbar) HOT 1
- reloadDataAnimated crash app HOT 1
- hidesBottomBarWhenPushed does not work HOT 1
- Scale bug take 2 HOT 6
- How to use it with TableViewController?
- <Error>: CGAffineTransformInvert: singular matrix. HOT 2
- Disable Multiple selections
- Click on KLControllerCard set Card in fullscreen state HOT 1
- Hide Navigation Bar on Show HOT 1
- Sizing/ Scaling issue HOT 6
- iOS 7 status bar issue HOT 1
- Change State of KLControllerCard HOT 2
- How can I get the size of noteView opened and closed? HOT 3
- Rotate interface: landscape and portrait HOT 1
- Issue when adding new view controller HOT 1
- Long press then slide the card is not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from klnoteviewcontroller.