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 08-17-2011, 05:12 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 98
RichardCornet is on a distinguished road
Default UIViewController help urgent!!!!

Hi

I have an app that is currently linking to a variety of different UIViewControllers, i would like to limit the amount of ViewControllers as it will get rather crowded and save memory.

Could anyone help me with the following problem please!

I have a list of players in a band that i would like to display biographies and an image for.

I have a menu page and would like it so that when the user clicks on a particular band members name it pushes in a view controller (playerpushedViewController) and puts in the relevant band members biography into a UITextView and their picture into a UIImageView.

For th purpose of any coding i and an example i am using band member ones biography as "band1.txt" and their image as "band1.jpg"

At the moment i am using the following code to load my view controller

Code:
- (IBAction)switch1:(id)sender;
{
    pushedplayerViewController *third =[[pushedplayerViewController alloc] initWithNibName:nil bundle:nil];
	[self presentModalViewController:third animated:YES];
    

}
any ideas anyone

(ps i have managed to do it by using separate ViewControllers but would like to use one as i have 28 band members)
RichardCornet is offline   Reply With Quote
Old 08-17-2011, 05:17 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 241
MattW is on a distinguished road
Default

Quote:
Originally Posted by RichardCornet View Post
Hi

I have an app that is currently linking to a variety of different UIViewControllers, i would like to limit the amount of ViewControllers as it will get rather crowded and save memory.

Could anyone help me with the following problem please!

I have a list of players in a band that i would like to display biographies and an image for.

I have a menu page and would like it so that when the user clicks on a particular band members name it pushes in a view controller (playerpushedViewController) and puts in the relevant band members biography into a UITextView and their picture into a UIImageView.

For th purpose of any coding i and an example i am using band member ones biography as "band1.txt" and their image as "band1.jpg"

At the moment i am using the following code to load my view controller

Code:
- (IBAction)switch1:(id)sender;
{
    pushedplayerViewController *third =[[pushedplayerViewController alloc] initWithNibName:nil bundle:nil];
	[self presentModalViewController:third animated:YES];
    

}
any ideas anyone

(ps i have managed to do it by using separate ViewControllers but would like to use one as i have 28 band members)
Before you present your view controller, load your data from the text file:

Code:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"YourFileName" ofType:@"txt"];   
NSData *txtData = [NSData dataWithContentsOfFile:filePath];
Store the data in your new view controller (I'm guessing you'll have a description string and an image name in the text file?). Then, in your new view controller's viewWillAppear() function, set the UITextField data and UIImageView with what you stored earlier.
__________________

Highlight PDF text like no other app: iHighlight (now available for iPad and iPhone!)
-----
Create iPhone lists with no typing: Insta-List
-----
Make spelling fun, and create your own tests: iWillSpell
-----
A fast, elegant flashlight app: Insta-Light
-----


FourSixteen Productions
MattW is offline   Reply With Quote
Reply

Bookmarks

Tags
uitextview

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: 392
13 members and 379 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, jimmyon122, jonathandeknudt, pungs, raymng, stanny, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

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