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 04-21-2008, 01:29 PM   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: Lexington, KY
Posts: 108
Fastrak is an unknown quantity at this point
Default Modal display is not working correctly

After killing much time trying to figure out something with modal displays - I opened up Apple's example NavBar

If you;

1 - run this app
2- select "View 5" from the list
3- then click OK on the modal window that appears
4 - repeat steps 2-3 several times

eventually what happens is that only view 1 will be presented when you click View 5.

I am posting this to try to prevent someone else from wasting a bunch of time (as I did) trying to track down a peculiar behavior in their program.
Fastrak is offline   Reply With Quote
Old 04-21-2008, 01:43 PM   #2 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 298
javid.alimohideen is an unknown quantity at this point
Default Re: Modal display is not working correctly

I have noticed the issue with the demo too. But it just worked once for me and i was not able to get it work again. But, the code works, just copy the code into your project and see if it works for you too.
javid.alimohideen is offline   Reply With Quote
Old 04-21-2008, 03:19 PM   #3 (permalink)
New Member
 
Join Date: Apr 2008
Location: Lexington, KY
Posts: 108
Fastrak is an unknown quantity at this point
Default Re: Modal display is not working correctly

Quote:
Originally Posted by javid.alimohideen
I have noticed the issue with the demo too. But it just worked once for me and i was not able to get it work again. But, the code works, just copy the code into your project and see if it works for you too.

Uh..If it worked just once for you then did not work again then IT DOESNT WORK!!!! That was the whole point of my post
Fastrak is offline   Reply With Quote
Old 04-21-2008, 03:33 PM   #4 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 298
javid.alimohideen is an unknown quantity at this point
Default Re: Modal display is not working correctly

Yes, you are right. But, your topic subject was Modal Display does not work which means modal views don't work at all. It just doesn't work in the demo program provided by the apple but it should definitely work in your project. Because, I am using Modal views in my application and it works perfectly fine.
javid.alimohideen is offline   Reply With Quote
Old 04-21-2008, 03:46 PM   #5 (permalink)
New Member
 
Join Date: Apr 2008
Location: Lexington, KY
Posts: 108
Fastrak is an unknown quantity at this point
Default Re: Modal display is not working correctly

Are you using an alertSheet or calling presentModalViewController?

Alertsheets are working fine for me - the specific trouble is with presentModalViewController.
Fastrak is offline   Reply With Quote
Old 04-21-2008, 04:07 PM   #6 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 298
javid.alimohideen is an unknown quantity at this point
Default Re: Modal display is not working correctly

I am using the presentModalViewController.
javid.alimohideen is offline   Reply With Quote
Old 04-21-2008, 04:45 PM   #7 (permalink)
New Member
 
Join Date: Apr 2008
Location: Lexington, KY
Posts: 108
Fastrak is an unknown quantity at this point
Default Re: Modal display is not working correctly

What are you calling when you are done with the view?

The apple example calls
[self.navigationController dismissModalViewControllerAnimated:YES];

Did you use setModalViewController before you asked for the modal view to be shown?
Fastrak is offline   Reply With Quote
Old 04-21-2008, 05:18 PM   #8 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 298
javid.alimohideen is an unknown quantity at this point
Default Re: Modal display is not working correctly

I show my modal view from my main view controller using code below
Code:
[self.navigationController presentModalViewController: myModalViewController animated:YES];
and in my ModalViewController class i dismiss it with a button action
using code below
Code:
-(void) dismiss:(id)sender
{
   [self dismissModalViewControllerAnimated:YES];
}
javid.alimohideen is offline   Reply With Quote
Old 04-21-2008, 05:50 PM   #9 (permalink)
New Member
 
Join Date: Apr 2008
Location: Lexington, KY
Posts: 108
Fastrak is an unknown quantity at this point
Default Re: Modal display is not working correctly

Nope still getting the same result.

If the modal view is called from an indexed caller like:
- (void)segmentActionid)sender
{
NSLog(@"segmentAction: selected segment = %d", [sender selectedSegmentIndex]);
switch ([sender selectedSegmentIndex]) {
case 0:
[self flipToageNum-1];
break;
case 1:
// show modal form!
[self.navigationController presentModalViewController: modalList animated:YES];
break;
case 2:
[self flipToageNum+1];
break;
default:
break;

after the modal view is called and dismissed, a click on any segment always returns segmentindex 0
Display from console:
4/21/08 7:00:56 PM Transitions[3249] segmentAction: selected segment = 1
4/21/08 7:00:57 PM Transitions[3249] segmentAction: selected segment = -1
4/21/08 7:01:05 PM Transitions[3249] segmentAction: selected segment = 0
4/21/08 7:01:05 PM Transitions[3249] segmentAction: selected segment = -1
4/21/08 7:01:13 PM Transitions[3249] segmentAction: selected segment = 0
4/21/08 7:01:13 PM Transitions[3249] segmentAction: selected segment = -1
I guess a -1 is issued when my button pops back up BUT I clicked the middle button 3 times and you can see that the wrong index is reported after the modal view was displayed

if I comment out the call to display the modalview, the console reports:
4/21/08 7:04:21 PM Transitions[3273] segmentAction: selected segment = 1
4/21/08 7:04:22 PM Transitions[3273] segmentAction: selected segment = -1
4/21/08 7:04:24 PM Transitions[3273] segmentAction: selected segment = 1
4/21/08 7:04:24 PM Transitions[3273] segmentAction: selected segment = -1
4/21/08 7:04:25 PM Transitions[3273] segmentAction: selected segment = 1
4/21/08 7:04:25 PM Transitions[3273] segmentAction: selected segment = -1

If you use a button to call it (instead of something that takes an index) everything works correctly
Fastrak is offline   Reply With Quote
Old 04-21-2008, 06:54 PM   #10 (permalink)
New Member
 
Join Date: Apr 2008
Posts: 802
scottiphone is on a distinguished road
Default Re: Modal display is not working correctly

I've had the same problem with segmented controls.
It should be noted that modal displays tend to reshuffle the view layers a bit so you may have to restore order your segmented control or other views.
scottiphone 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use one controller for Modal/Non-modal viewing? pendraggon87 iPhone SDK Development 2 07-02-2008 12:07 PM
UIWindow working right?? cdwiegand iPhone SDK Development 1 06-29-2008 10:23 PM
beta8: UIWebView not redrawing correctly when offscreen? bonehead iPhone SDK Development 0 06-28-2008 04:37 PM
display image from xml sangau001 iPhone SDK Development 2 06-15-2008 02:09 PM
How to display image from URL in UITableView odbc2000 iPhone SDK Development 1 05-22-2008 05:40 AM


» Advertisements
» Online Users: 406
15 members and 391 guests
13dario13, 7twenty7, buggen, eski, EvilElf, glenn_sayers, j.b.rajesh@gmail.com, LunarMoon, morterbaher, n00b, QuantumDoja, sacha1996, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

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