[iPhone] "Refreshing" a pageControl

I've got a pageControll based viewcontroller in my app, based off Apple's sample. Works pretty great, but I'm having a little trouble refreshing it when I add a new page. It acts in a Flip/Utility view combo. I can do my flipping fine, add a new "element" on the flipside, but when I flip back around, I can't quite get it to refresh properly.. I update the pageControl's numberOfPages, I load the new page. When I scroll to the new page, it won't let me scroll to it. It "shows" me the page, but it's as if I'm scrolling off the bounds (the view is there but it's treated like when you try scrolling past the far end of the pageControl.
Here's the relevant source... I hope somebody can help, it's driving me up the wall and I can't figure it out!
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSLog(@"appear!");
NSMutableArray *theControllers = [[NSMutableArray alloc] init];
for (unsigned i = 0; i < dataController.courseItems.count; i++) {
[theControllers addObject:[NSNull null]];
self.controllas = theControllers;
[theControllers release];
pageControl.numberOfPages = dataController.courseItems.count;
pageControl.currentPage = 0;
[self loadScrollViewWithPage:0];
[self loadScrollViewWithPage:1];
- (void)viewDidLoad {
[super viewDidLoad];
pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, 400, 320, 18)];
pageControl.hidesForSinglePage = NO;
pageControl.backgroundColor = [UIColor clearColor];
pageControl.numberOfPages = dataController.courseItems.count;
[self.view addSubview:pageControl];
[self.view setBackgroundColor:[UIColor blackColor]];
// a page is the width of the scroll view
scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];
[self.view addSubview:scrollView];
scrollView.pagingEnabled = YES;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * dataController.courseItems.count , scrollView.frame.size.height);
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.scrollsToTop = NO;
scrollView.delegate = self;
[self viewWillAppear:YES];
- (void)loadScrollViewWithPage:(int)page {
if (page < 0) return;
if (page >= dataController.courseItems.count) return;
// replace the placeholder if needed
JBCoursesViewController *theController = [controllas objectAtIndex:page];
if ((NSNull *)theController == [NSNull null]) {
theController = [[JBCoursesViewController alloc] initWithNibName:nil bundle:nil];
theController.editingItem = [dataController.courseItems objectAtIndex:page];
[controllas replaceObjectAtIndex:page withObject:theController];
[theController release];
if (nil == theController.view.superview) {
CGRect frame = scrollView.frame;
frame.origin.x = frame.size.width * page;
frame.origin.y = 0;
theController.view.frame = frame;
[scrollView addSubview:theController.view];
- (void)scrollViewDidScroll:(UIScrollView *)sender {
// switch the indicator when more than 50% has scrolled
CGFloat pageWidth = scrollView.frame.size.width;
int page = floor((scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
pageControl.currentPage = page;
[self loadScrollViewWithPage:page - 1];
[self loadScrollViewWithPage:page];
[self loadScrollViewWithPage:page + 1];

hello
i am also facing a problem.
first problem is why the first view loaded twice in the example??
second problem is
i am generating a view as page control sample did.
but i want to add another view with flip animation for example.
i click on a table cell.the view is loading perfectly with my desired data.
but i am unable to load previous view....
means if i click on cell 5 i also want to go back to previous 4 views but unable to do it.
third problem is
i want a another view for example i double tap on the view and it flips to a new view.on that new view i want to show some text.again tapping on thet view i want to show the previous view.but the problem is if i swipe to next view the other sides view is loaded but with black screen

Similar Messages

  • I would like to use a Sprint iPhone 5c on Verizon, ESN is clean

    I have a 5s on Verizon, but would also like to buy a 5c and use it too, using the same SIM card I'm using now.

    SoN1NjA wrote:
    Aren't there computer programs for things like this out there
    Not for the general public...in the four or five years since the Verizon iPhone 4 came out I cannot recall a single user saying they had success getting the iPhone refreshed.  Before buying, talk with Verizon, see what they say, talk with Sprint, see what they say about authorizing the flashing.  Since the iPhone is locked to Sprint, the authorization to unlock, i.e., flash is solely up to them.  Apple will not get involved, Verizon will not help unless Sprint authorizes it.  These are all contract-legal matters.

  • Iphone error out of options

    I am receiving an error while I am trying to update my apps on my iphone 4 that says "your apple ID has been disabled".  I have:
    changed apple id password and updated in:
    icloud
    itunes
    itunes store
    game center
    facetime
    I have turned my iphone on and off 2x
    went into settings in iphone refreshing itunes and still nothing?
    What can I do to fix this?
    Thank You

    lori5674 wrote:
    I am receiving an error while I am trying to update my apps on my iphone 4 that says "your apple ID has been disabled".
    If disabled for Security Reasons... See here  http://support.apple.com/kb/TS2446
    If not for Security reasons...
    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Image loading

    Hi everyone! This is probably a silly question, but I'm trying to put together an app for the iphone and I've been looking at the 'page control' sample code (http://developer.apple.com/iphone/library/samplecode/PageControl/index.html) from the apple dev centre, which basically just creates new copies of a template page and changes a label to reflect the page number. I'd like to do the same thing, but use an image instead of a label, and use the page number as part of the filename for the image. For instance page one will load and display 'xx1.png', page 3 will load and display 'xx3.png' etc.
    I had a quick look at the help file in xcode, and I can't figure out how to do this. If anyone could help me out it would be much, much appreciated
    Thank you in advance!

    EJP wrote:
    Which suggests that your guess is wrong.
    @Daryl I think you could cool off a touch ;-)My question wasn't rhetoric. Since the OP had been posting questions in the FX 2 forum, I wanted to make an informed decision whether to move the thread or not.
    Nothing in my post implied that I wasn't cool. That was just your assumption.
    db

  • GPS not working and my attempts to fix it.

    Hi All,
    I recently tried to use my GPS after not using it for a few months and it has stopped working. Only the triangulation is working. in an attempt to fix it I completely reset my iphone using these steps:
    http://www.navigon.com/portal/int/kundenservice/faq.html?id=11268&content_identi fier=faq&page=1&faqTopic=iphone
    However, these steps have not resolved the problem
    The iphone is now out of contract and warranty and I could upgrade however, im sure apple will have an iphone refresh ready this June, so im reluctant to get a new one just yet.
    Does anyone know anything else I can try.
    Thanks
    Skeep

    Check whether your Compass app is working, as mine suddenly stopped a couple of months agao.
    A "Restore as new phone" in iTunes cured the problem for me (you will lose application and games data and old sms messages but will be able to simply re-sync everything else)

  • Recent iOS related news and links

    Apple has recently updated the terms for their developer program license.  In particular, they've made a change to section 3.3.1 which allows a wider range of tools and languages to be used when creating iOS applications.  This allows developers to once again create AIR applications for iOS!  In fact, AIR developers have already built, submitted and accepted apps into the Apple Marketplace.  Here's a few links to helpful pages.  I'll add more as I find them.
    Adobe's official blog post on the topic:
    Great New for Developers
    Christian Cantrell has posted a great tutorial on the Packager for iPhone:
    Packager for iPhone Refresher
    We're looking forward hearing your feedback and questions.  If you've created an app that's made it into the store, please, post and let us know!

    Adobe Platform Evangelist, Lee Brimelow, has just released a new video tutorial on setting up a Windows environment for iOS development.

  • Application Loader unable to unzip .ipa file

    I am developing under Flash Professional CS5, working on a PC.  Using the development distribution files, my application builds and I can run it on iPhone, iPad, and iPod.  Now I am trying to get it to the App Store.  I have a distribution certificate which I got before Apple pulled the plug, and was able then to just change the extension to .zip and upload to the App Store (where of course it got stuck until now). This week I rejected my binary in the store, and built an updated version.  You can't just upload to the App Store any more; you need to use the Apple Application Loader. This, of course, only runs on a Mac.  So, I downloaded and installed the latest version on my Mac. transferred the .ipa to a memory stick, and gave it to the Loader.
    I get this curt message    "Unable to unzip application"
    I have tried renaming it to .zip.
    I have tried extracting the Payload and zipping that up again (different error but still no good)
    Has anyone else got any applications built on a PC uploaded recently?  Please tell what you did

    I had almost the same problem. I'm on OS X though. I have my issue solved but it took a lot of trial and error. There were enough clues on this thread though to get me there so thanks everyone. Here's what I went through and what I've discovered:
    I compile with Flash CS5
    (I was trying Christian's way on the commandline but I forget why I couldn't get it to work, must try it again now. ref:
    http://blogs.adobe.com/cantrell/archives/2010/09/packager-for-iphone-refresher.html)
    This creates my .ipa file. I don't know if I need to use the commandline, but I did in order to rename the .ipa file to a .zip file. I then double clicked the .zip in the Finder which unzips it with the default OS X app, not 7 zip or something third party. This produces a folder called Payload. If my swf is set in Flash to publish to Main.swf, then inside Payload I see Main.app
    I zip Main.app by right clicking it in the Finder and select the Compress option, again, default OS X compression stuff.
    This is the correct way to create the ipa file, and produce the kind of zip file that Application Loader wants.
    Along the way, I encountered some other distracting problems. I'll explain those now, but they are not related to the actual ipa/zip/unzip problem.
    I had two errors, one about a bad bundle ID. This was in fact a typo I had by one letter. In my case it was ca.abcd.abcs in iTunes Connect, and in Flash CS5's settings, it was ca.abcd.abc. That was a forehead slapper I tell you.
    The other error was my app not being signed with a proper certificate. I knew I was using my app store certificate, not my dev certificate (this is important btw). I tried revoking my certificate in the app store as @JimmyInteractive mentioned, but I don't think in my case this was necessary. I still had the same issue after revoking. Avoid this if you can because it's a pain in the a$$ to set up all your provisioning profiles again on iTunes Connect and in Keychain, XCode etc. Prior to trying to get everything up onto the app store, I had of course been developing on my personal device, with my developer certificate. What I forgot to do for app store distribution, is in Flash CS5 change Certificate to my app store .p12 file. I still had it set to my dev .p12 file. Doh!
    After I did that and figured out the zipping stuff it all worked. Hope this helps!

  • PFI References

    This is an attempt to gather useful links into one convenient location for the Packager for iPhone community. This forum has been invaluable when trying to solve the many issues there are with the current PFI, preview version 2, and so I thought I'd try to give something back.
    There is no "Search this Forum" button, so here is a link for searching just the Packager for iPhone forum
    http://forums.adobe.com/search.jspa?q=&resultTypes=MESSAGE&peopleEnabled=true&dateRange=al l&communityID=4333
    Downloads and Official Documentation:
    Download the Packager for iPhone (CS5 users use next link)
    http://labs.adobe.com/technologies/packagerforiphone/
    Flash Professional CS5 update for iOS (update to C5 11.0.2 first)
    http://www.adobe.com/support/flash/downloads.html#flashCS5
    Packager for iPhone: Release Notes and Known Issues
    http://labs.adobe.com/wiki/index.php/Packager_for_iPhone:Release_Notes
    Packager for iPhone: Developer FAQ
    http://labs.adobe.com/wiki/index.php/Packager_for_iPhone:Developer_FAQ
    Packager for iPhone: Documentation
    http://help.adobe.com/en_US/as3/iphone/
    http://help.adobe.com/en_US/as3/mobile/
    Packager for iPhone: Developer Guide PDF
    http://download.macromedia.com/pub/labs/packagerforiphone/packagerforiphone_devguide.pdf
    Packager for iPhone Refresher (not a recommended workflow for Flash CS5 users, but may be useful to those using other tools)
    http://blogs.adobe.com/cantrell/archives/2010/09/packager-for-iphone-refresher.html
    NOTE: The latest AIR SDK is version 2.5, not 2.0.2 as stated at the above link, though the download link takes you to the latest SDK version.
    Optimization Techniques:
    Optimizing content for Apple iOS devices
    http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
    Packager for iPhone: Render Performance
    http://www.yeahbutisitflash.com/?p=986
    Please help this community by replying to this thread with any links that you have personally found useful, and I'll try to update the main post.
    cr0ybot 02/25/11 - added second iPhone Documentation link

    I don't know for sure actually. But, why not just close them and not have to wonder hope? The close reference function will take an array of references so it's not much extra code.
    CLA, LabVIEW Versions 2010-2013

  • My new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

  • IOS 7 iPhone 4 slow to refresh/update data

    Apps like Weather, Email, and Notifications seem to have slowed down in updating/refreshing data.  When I check notification center, the weather data is usually hours old.  If I open the weather app it also has the older data but quickly refreshes.  If I go back to Notification Center, it takes several more minutes to update.  If I read emails on another device, they are still marked an unread on iPhone until I open the app or manually refresh.  Anyone else having these issues?  Could it be just that the servers are so stressed from upgrades that some push notifications have slowed down?
    Before you ask, current settings:
    Backgroud App Refresh: On (enabled for weather)
    Location Services: ON (enabled for weather)
    Notifications:  All services enabled in Today View
    Mail - Fetch New Data: Push
    If email is not a Push account, set to Fetch Every 15 Minutes

    Figured it out.
    The photos that I thought were on the phone where in the cloud, so there wasnt actually a photo folder created yet in the camera.
    Took a picture, reconnected phone and viola, there it was.

  • TS3276 ppl i fed up with my mac air while using my exchange email account, it takes ages to refresh and it doesn't send or receive instantly , no clue although that the same setting and server names has been set up on my iPhone and it is working fine

    ppl i fed up with my mac air while using my exchange email account, it takes ages to refresh and it doesn't send or receive instantly , no clue although that the same setting and server names has been set up on my iPhone and it is working totally fine

    Install ClamXav and run a scan with that. It should pick up any trojans.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • On my iPhone when I go on phone to view my contacts on the top left corner there is a circle with a arrow ( like a refresh icon ), just want to know what is it?

    On my iPhone when I go on phone to view my contacts on the top left corner there is a circle with a arrow ( like a refresh icon ), just want to know what is it?

    That's exactly what it does, refresh your contacts. As an example if you add a contact on your Mac or iPad and you use iCloud to sync them altogether, then this can be used to refresh the contacts on your iPhone. 

  • TS4268 iPhone users can no longer send me text messages now that i've moved to a non-iOS phone. Can iMessage service or Message users be refreshed to see me as a normal text message recipient?

    iPhone users can no longer send me text messages now that i've moved to a non-iOS phone. Can iMessage service or Message users be refreshed to see me as a normal text message recipient?
    I still have an iPhone, but haven't turned it on for weeks. And there's no SIM in it, so no cell service, just WiFi.  When I turn it on after a prolonged period of having it off (weeks), a bunch of messages popup that should have been forwarded to my new phone (same phone number and carrier as when I was an iPhone user) but appear to sit in iMessage queue indefinitely instead.
    I'm guessing it has to do with the link that's made when an iPhone first realizes that it's talking to another iPhone and defaults, for all future texts, to iMessage.  You know, the green to blue switch.  How does that association get undone?
    Has anyone else seen this, and if so, is there a fix?

    your number can remain on the imessage server for some time

  • HT4061 How do I refresh the Find My iPhone map now that they have "upgraded" the product? There is no longer a refresh button.

    Until this week there was a button next to the device identification that allowed you to refresh the Find My iPhone map.  That button is now gone and I cannot see a way to refresh the map without exiting and reentering Find My iPhone.  Any help would be appreciated.  Thank you.

    You need to go to the part where you see your device on the map and then there is a little refresh button next to the name of your device on the map page.

  • HT4972 i am not getting notification on most of my apps, e.g twitter and facebook...except i go to the app and refreshed manually. its an iphone 4 and running on ios5...i have gone through everything and its still the same..help please........I seem to be

    i am not getting notification on most of my apps, e.g twitter and facebook...except i go to the app and refreshed manually. its an iphone 4 and running on ios5...i have gone through everything and its still the same..help please........
    I seem to be having the same problem on my brand new iPhone 4S. Everything was working fine on the phone until I updated to iOS 5.1.1, but now I no longer receive push notifications for the native Mail app, Instagram, or the Facebook app. I still seem to be receiving SMS texts and iMessages via push, but the aforementioned apps need to be opened before I can receive missed notifications (having them open in the background seems to make no difference).
    Thanks for any help that you may provide!

    did you try notifications under settings? You can customize it as per your requirement, for each application.
    check this out: http://www.gottabemobile.com/2011/10/12/ios-5-how-to-use-notification-center/ or http://reviews.cnet.com/8301-19512_7-20120625-233/ios-5-notifications-a-deeper-l ook/

Maybe you are looking for