Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-14-2011, 04:38 AM   #1 (permalink)
- U haz disappoint -
 
Join Date: Jan 2010
Location: Belgium
Posts: 489
jNoxx is on a distinguished road
Send a message via MSN to jNoxx Send a message via Skype™ to jNoxx
Default Subclassing Methods

Hey developers,

Actually, I haven't worked alot with Subclassing.
But I am using this library, Leaves. And I had a question this time too

So, I have this class called leavesview.h
My PDFViewController subclasses this like this -->

Code:
@interface PDFExampleViewController : LeavesViewController
Inside that view, I call a popover like this -->

Code:
- (IBAction) showTOC:(id)sender {
	NSLog(@"showTOC called");
	//IndexViewController *indexViewController = [[IndexViewController alloc] init];
	if (![popoverController isPopoverVisible]){
		myPopOver = [[MyPopOverView alloc] initWithNibName:@"MyPopOverView" bundle:nil];
		popoverController = [[UIPopoverController alloc] initWithContentViewController:myPopOver];
		[popoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
	} else{
		[popoverController dismissPopoverAnimated:YES];
	}
}
Which shows from the UIButton ^_-

I load some XML shizzle and stuff in there and load to the directory.

Then inside that popoverview, (UITableView). i have this method -->

Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
	//int pageNumber = 3;
	NSUInteger pageNumber = 3;
	[leavesView setCurrentPageIndex:pageNumber-1];
	
	NSLog(@"didSelect fired");
}
So, that gets triggered, but never actually changes it.
but if I do this in my PDFViewController in the viewDidLoad or whatever.
It get's called. so my question was, how is the design pattern in this matter.

the currentPageIndex code goes like this -->

Code:
- (void) setCurrentPageIndex:(NSUInteger)aCurrentPageIndex {
    currentPageIndex = aCurrentPageIndex;
	if (self.mode == LeavesViewModeFacingPages && aCurrentPageIndex % 2 != 0) {
        currentPageIndex = aCurrentPageIndex + 1;
    }
	
	[CATransaction begin];
	[CATransaction setValue:(id)kCFBooleanTrue
					 forKey:kCATransactionDisableActions];
	
	[self getImages];
	
	self.leafEdge = 1.0;
	
	[CATransaction commit];
}
I know it's hard, and I think it's a mather of design pattern errors.
I first' discovered the leavesView in my didSelectRowAtIndex was nil, so i Init that in the viewDidLoad, so it doesn't return nil, so it references to there, but can't figure out why it isn't calling the function (decently).

Any idea's, let me know ^_-

Greets. Noxx
jNoxx is offline   Reply With Quote
Old 02-17-2011, 03:22 AM   #2 (permalink)
- U haz disappoint -
 
Join Date: Jan 2010
Location: Belgium
Posts: 489
jNoxx is on a distinguished road
Send a message via MSN to jNoxx Send a message via Skype™ to jNoxx
Default

Anyone knows?

I have some other questions, but I have to get this working first x)
Weird thing is, if i call it inside the PDFController works, but they subclass the same file.. So don't get it. So, let me know please
jNoxx is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 376
9 members and 367 guests
chemistry, cpsclicker, daudrizek, jeroenkeij, Kirkout, PavelMik, teebee74, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:04 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0