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 Tools & Utilities

Reply
 
LinkBack Thread Tools Display Modes
Old 12-16-2011, 12:35 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 4
nick.naveen is on a distinguished road
Default Three20 framework problem

I have created a sample photo viewer using Three20 given at How To Use the Three20 Photo Viewer | Ray Wenderlich and i have also created an app for image editing in which we can draw any shapes on image by moving pointer on the image. In Three20 there is a TTPhotoViewer class. It has following method

- (void)loadView {
CGRect screenFrame = [UIScreen mainScreen].bounds;
self.view = [[[UIView alloc] initWithFrame:screenFrame] autorelease];

CGRect innerFrame = CGRectMake(0, 0,
screenFrame.size.width, screenFrame.size.height);
_innerView = [[UIView alloc] initWithFrame:innerFrame];
_innerView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizing FlexibleHeight;
[self.view addSubview:_innerView];

_scrollView = [[TTScrollView alloc] initWithFrame:screenFrame];
_scrollView.delegate = self;
_scrollView.dataSource = self;
_scrollView.rotateEnabled = NO;
_scrollView.backgroundColor = [UIColor blackColor];
_scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizing FlexibleHeight;
[_innerView addSubview:_scrollView];

_nextButton =
[[UIBarButtonItem alloc] initWithImage:TTIMAGE(@"bundle://Three20.bundle/images/nextIcon.png")
style:UIBarButtonItemStylePlain
target:self
action:@selector(nextAction)];
_previousButton =
[[UIBarButtonItem alloc] initWithImage:
TTIMAGE(@"bundle://Three20.bundle/images/previousIcon.png")
style:UIBarButtonItemStylePlain
target:self
action:@selector(previousAction)];

UIBarButtonItem* playButton =
[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemP lay
target:self
action:@selector(playAction)]
autorelease];
playButton.tag = 1;

UIBarItem* space = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:
UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease];

_toolbar = [[UIToolbar alloc] initWithFrame:
CGRectMake(0, screenFrame.size.height - TT_ROW_HEIGHT,
screenFrame.size.width, TT_ROW_HEIGHT)];
if (self.navigationBarStyle == UIBarStyleDefault) {
_toolbar.tintColor = TTSTYLEVAR(toolbarTintColor);
}

_toolbar.barStyle = self.navigationBarStyle;
_toolbar.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizing FlexibleTopMargin;
_toolbar.items = [NSArray arrayWithObjects:
space, _previousButton, space, _nextButton, space, nil];
[_innerView addSubview:_toolbar];
}

I implemented TTPhotoViewer protocol in my class and set the photoSource property of TTPhotoViewer in my my class. I am only supplying the photo source containing only photos of type TTPhoto to TTPhotoViewer protocol. Now i want to call my new custom class whenever i click on the photo. I have made a TTURLMap object in my Delegate.

[map from:@"tt://photo" toSharedViewController:[PhotoView class]];
Now i want to add a click event on photo that will request for the url tt://photo and execute my PhotoView class. Please note that i am only providing the PhotoSet object to TTPhotoViewController and rest of the work is done by Three20 TTPhotoViewController class.

How can we call our custom class when click on the image displayed in the photo album?
nick.naveen is offline   Reply With Quote
Reply

Bookmarks

Tags
ios, iphone, three20 sdk

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: 461
16 members and 445 guests
7twenty7, brandon6031, David-T, Dj_kades, Elad, HemiMG, iAppDeveloper, jeroenkeij, LunarMoon, Mijator, Pauluz85, PixelInteractive, QuantumDoja, sacha1996, smithdale87, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,928
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

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