Question about Pagecontrol sample app

Hi,
I've been looking at some sample apps to help with a beginners project that I'm doing. There is a Apple sample app for PageControl.
The app delegate contains this code (I hope I'm OK to include this here, please tell if not)
// replace the placeholder if necessary
MyViewController *controller = [viewControllers objectAtIndex:page];
if ((NSNull *)controller == [NSNull null]) {
controller = [[MyViewController alloc] initWithPageNumber:page];
[viewControllers replaceObjectAtIndex:page withObject:controller];
[controller release];
// add the controller's view to the scroll view
if (nil == controller.view.superview) {
CGRect frame = scrollView.frame;
frame.origin.x = frame.size.width * page;
frame.origin.y = 0;
controller.view.frame = frame;
[scrollView addSubview:controller.view];
I've highlighted two lines and my question is: how can controller be used when it has already been released in the previous section?
I'm very new to this and I thought that releaseing an object meant that you could no longer get to it?
Many Thanks in advance
Ziximo
Message was edited by: Ziximo

Objects aren't deallocated until their retain count goes to zero. When the controller is alloced its retain count is one. When the controller is added to the array its retain count is incremented to two. It's then released to reduce the count to one. Assuming the controller isn't retained by any other object, it will be dealloced when it's removed from (and thus released by) the array. - Ray

Similar Messages

  • Please i have a question about to YOUTUBE App.

    Dear all,
    i have a question about YOUTUBE app.
    i have Iphone 3G.
    as i use youtube a new error message has appeared "Cannot Connect to YouTube"
    noted that i could't use YouTube before.
    Thanks ,
    Ashraf

    I don't use that app. I just go to the web based site. You can share videos from the site, but not from the app, as far as I have been able to do. Try the web based version and see if you get the same error. Go through Safari is what I mean.

  • Questions About Gifting an App

    I've never "gifted" an App-Store app before, but I see "http://mashable.com/2010/03/22/itunes-app-gifting" tells a little more about the process.
    Between that and searching in the discussions here, best I can tell (correct me if I'm mistaken):
    * I identify the recipient by name and Email address.
    * Sender and recipient need to be in the same country.
    Questions:
    * How does the app "arrive"? It looks like it sends an Email message or lets you print out a coupon, right? That as opposed to, for example, popping up a badge on the recipient's App Store icon, or popping up an alert banner ("Santa123 just gave you an App," or something like that).
    * Best I can tell, there's no option to make the gift "arrive" at a particular time/date (e.g., Christmas morning). That is, the recipient always gets a coupon in Email immediately (if you use the Email option), right?
    * Can the App Store check to see whether the recipient already has the app? Relatedly, can I return the gifted app if s/he already has it?
    * When I gift an app, does it appear as one of his/her apps just like any other, or we have to do something ... special in subsequent syncs?

    Best I can tell, there's no option to make the gift "arrive" at a particular time/date (e.g., Christmas morning). That is, the recipient always gets a coupon in Email immediately
    Correct.
    Can the App Store check to see whether the recipient already has the app?
    No.
    can I return the gifted app if s/he already has it?
    No, unless iTunes support makes an exception.
    When I gift an app, does it appear as one of his/her apps just like any other, or we have to do something ... special in subsequent syncs?
    They get a code, which they redeem & then the app downloads to their account.
    You can also gift an allowance to avoid the above, that way they can purchase what they want.

  • General question about uploading web apps

    i have my site completed and it works on the testing server
    without a glitch. i've uploaded static sites before without a
    hitch, but i'm not so certain about web apps. seems when you upload
    the site with dw, it uploads the html and php . . . but then there
    are the tables from the db. uploading them and getting them to hook
    up all over again . . . how do you do that? can someone review the
    steps please. thanks.

    something like this:
    1. check your remote server has phpMyAdmin installed and the
    URL to
    access it (phpMyAdmin is a web app written in PHP and you
    access it
    through a browser)
    2. download and install phpMyAdmin locally
    3. run phpMyAdmin, usually
    http://localhost/phpMyAdmin,
    but the url will
    vary depending the installation and your development
    platform.
    export your local DB; phpMyAdmin will create a file named by
    default
    "localhost.sql". depending your browser configuratioon you
    can change
    the file name/choose where to save
    4. run phpMyAdmin in the remote server and import your DB
    just choosing
    the file in step 3
    later you can export/import tables instead the full DB. if
    you're
    reimporting the DB remember to check the "Add DROP DATABASE"
    checkbox
    when exporting
    you can't see any files in the server with phpMyAdmin, it's
    only a
    visual interface to the MySQL server. keep using DW to
    create/modify/upload html, js and php files
    hconnorjr wrote:
    > so the steps go something like this:
    > 1. find db to upload from testing server
    > 2. go to new server. find the directory that is used for
    databases (presumably
    > one that the admin has already set up for apache/php to
    look for db tables.
    > make a db of the same name as in your testing server.
    > 3. use phpMyadmin on the testing server and make backup
    of your db. since its
    > new for the production server use the default values. in
    this step the db can
    > also be backed up by tables if its large and upload time
    might be an issue.
    > 4. go the the new server. with the phpMyadmin on that
    server, name a database
    > with the same name as the one on the testing server. use
    IMPORT. go to the
    > browse button and find the db on your testing server and
    IMPORT it.
    >
    > small question: i can see the files on the remote server
    from dw when its
    > properly set up, but does phpMyadmin allow me to see
    files on my testing server
    > without some configuration?
    >

  • Question about VacationRequest sample

    Hi
    Thank you for reading my post.
    I have looked at some of Oracle SOA suite sample and one of them is VacationRequest under bpel demos folder.
    What i can not understand is who's job is to develop the web pages that are show in the
    http://localhost/integration/worklistapp/TaskList ?
    a page like :
    http://i12.tinypic.com/33wus8x.jpg
    does SOA suite generate it or developer should hard code the web ui?
    maybe it is the prototype test page, but any comment about this page with its good menu and them will be helpfull.
    thanks

    The SOA suite comes with a built in task list like that, but you can also create pages with this information on your own accessing the information from BPEL.
    For further SOA Suite question use their forum at:
    SOA Suite

  • Question about Backing Up apps and using Migration tool

    Since installing Leopard on my G5 PPC, I have been having a strange problem with the sleep, screen saver. Anytime the system goes into screensaver or sleep, it will not come back and will be frozen. Needless to say I was told by the Mac Genius guys that I need to do a clean install.
    So my real question now is about backing up all my apps and then using the migration tool to bring them back into the new install. I was going to attempt to use Carbon Copy Cloner on a second internal drive (Time Machine has never worked for me on my Lacie 500gb.) Once I have a full bootable copy, I will do a clean install (erase and install option) on my original drive, then I guess I am going to use the migration tool.
    So my questions are:
    1) Does this strategy seem like it will work?
    2) Is the migration tool straightforward? IE - Can I pick and choose what to put back on the new install?
    3) Any pitfalls that I should be aware of?
    I have already backed up my docs and data to the external, but I have so many programs with plugins installed that getting my apps back the way they are is essential to me.
    Thanks.

    Remember Time Machine is designed to do constant, incremental backups of your HDD. If you delete something from the internal HDD of the Mac it will no longer be backed up to the external HDD and will eventually be deleted from the backup archive as time passes and TM keeps doing its backups.
    What will probably be a better solution is to simply drag-n-drop the entire iTunes folder to an external HDD for backup and use that as the main iTunes library. The drawback to this is that to play the music you'll need to have the external HDD connected. Unless your plan is not to delete all the music from your MBP, just some of it.

  • Question about third party apps

    sorry to ask this dumb question but what apps are listed as third party apps because i dont know what apps is third party apps.

    Hello Shawn,
    Thank you for using Apple Support Communities.
    The following article provides information to troubleshoot apps. The section on "Contact the developer" will show you how to identify and contact the developer. And to answer your specific question, any app that is developed by a company other than Apple is a "third party app".
    iOS: An app you installed unexpectedly quits, stops responding, or won't open
    Regards,
    Jeff D. 

  • Question about WListBoxComposite sample plugin

    Hello everyone,
    I have a palette based on the WListBoxComposite sample plugin, now I need to change it(or completely replace it ) cause of new requirement. I used to have constant number of fields or columns with variables number of records corresponding with those fields/columns in this palette, now I get the number of fields/columns in runtime . My question is what would be the best approach to implement this ? to be more clear of what I want to do consider to want to show the personal information fields like name, address,....(that you you get them in runtime from a database) and want to show this information for employees in each row.
    Thanks,
    Kamran

    In your resource file you have a resource for the rows you put into the tree:<br /><br />>resource WLBCmpNodeWidget (kWLBCmpListElementRsrcID + index_enUS)<br />>{<br />>>     __FILE__, __LINE__,<br />><     kWLBCmpListParentWidgetId, kPMRsrcID_None,     // WidgetId, RsrcId<br />>>     kBindLeft | kBindRight,               // Frame binding<br /><br />Place a frame (GenericPanelWidget) inside the this to contain the dynamic widgets.<br /><br />Now create resource type in the resource file for each type of widget you need in the line. At runtime you instantiate a widget for each field: <br /><br />>InterfacePtr<IControlView> iControlView ((IControlView*)::CreateObject(::GetDataBase(this), RsrcSpec(LocaleSetting::GetLocale(), kYourPluginID, kViewRsrcType, kYourWidgetRsrcID), IID_ICONTROLVIEW));<br /><br />>iControlView->SetFrame(frame);  // The frame is the place you want it inside the content panel<br /><br />>iControlView-> SetWidgetID();  // you need to calculate this also, as you don't know how many you will have<br /><br />>yourContentFrame->AddWidget(iControlView);  // of type IPanelControlData which you can get in you TreeViewWidgetMgr<br /><br />If you dont want to use the resource files you can create it dynamically and set all the parameter through function calls:<br />>IControlView* iControlView = (IControlView*)::CreateObject(kYourWidgetBoss,IID_ICONTROLVIEW);<br /><br />You can also use the  kWLBCmpListParentWidgetId as a content frame for the widgets, but you then need to remember to take into account other "static" widgets you might have in the line.

  • Question about building an app for a single ad hoc distribution

    Say I want to build and app and send the app, along with a provisioning profile, to somebody to install via iTunes for beta testing.
    The "Ad Hoc" panel says the following:
    Ad Hoc distribution allows you to share your application with up to 100 iPhone or iPod touch users, and to distribute your application through email or by posting it to a web site or server. To prepare your application, the following steps will need to be completed.
    Create and Download an iPhone Distribution Certificate
    Create and Download an Ad Hoc Distribution Provisioning Profile
    Build your application with Xcode
    Share your application file and the Ad Hoc Distribution Provisioning Profile with the owner of each device
    Recipients of the application will need to drag the application file and Ad Hoc Distribution Provisioning Profile into iTunes, then sync their iPhone to iTunes to install
    My question is, do I have to build the application in the extremely complicated way described in the "distribution" tab which says "only the team agent" can do? Or is that for a mass distribution?
    Can I build my app like I do for the simulator and just send that along with the provisioning profile to the other person by email?
    What is the absolute easiest way of doing this sort of ad hoc distribution?
    Thanks!
    doug

    Another development device? I don't even have one yet.
    The person I'm developing with has one though.
    It turns out all that needed to be done was:
    (1) Build using the iPhone OS setting instead of the Simulator setting.
    (2) Set the provisioning profile.
    Then using the app and profile, just drop them on top of the apps section in iTune and synch.
    That's all there was too it. I didn't need to use all the 11 steps in the distribution section for just the ad hoc distribution, I'm happy to say!
    doug
    Message was edited by: Doug Lerner2

  • Questions about updating an app in the app store

    I'm a creative cloud menber working with the single edition DPS. My app has been approved by Apple and is in the store. But, of course, there is a typo. What do I need to know about submitting an updated version. Should it have a new version number say 1.1? Can I use all the same certificates both mobile provision and development 12? Is the review process more expediant when it's a update?
    thanks
    Chuck

    Hi Chuck,
    Subscribers to Adobe Creative Cloud can revise their apps (and submit their rebuilt apps to Apple) for as long as they are Creative Cloud subscribers. When you revise your app, use the same App ID and distribution provisioning profile to create the new custom viewer. In DPS App Builder, select the existing app you created, and click Edit. Specify the most recent app version, if desired, and follow the prompts to create a new app. Download and test the development file. In iTunes Connect, click Manage Your Applications, click the app you want to update, and then click Add Version. Follow the prompts, and then use Application Loader to upload the .zip file.
    Regards
    Prabhjyot

  • Question about distributing an app for free through the AppStore and taking payment for the online software separately

    We intend to sell a package of online software to Golf clubs. Part of the bundle is 25 iPhones that their members use whilst attending the club.  There is an app which is controlled and administered by the online software, each of the 25 apps need to have this app installed, and the AppStore is the best way for them to download it and be pushed updates.
    Would we be breaching Apple’s terms and conditions in any way by offering this app for free through the AppStore and taking payment for the online software separately (the iPhone app is completely unusable without the online software).
    Please could you advise?

    Probably a question best addressed either in the developers' forum or by contacting Apple directly.

  • A question about sst sample driver

    I have checked the Solaris 8 version of sst SCSI sample
    driver. There is one thing I couldn't understand:
    In the definition of sst_fill_cdb, sstprivp->priv_amt is used
    as transfer length. This variable is set to bp->b_bcount -
    pkt->pkt_resid in sst_make_cmd() when the pkt is allocated. But it is never updated during subsequent
    partial DMA transfers. Is this a bug or some thing other than the driver is updating this variable ( unlikely since
    this is private to the driver) ?
    Any explanations are very appreciated.

    Hi no1,
    Do these devices have drivers that you have installed? Do they have a driver application programming interface (API) that you can access, probably through a C++ DLL? I assume you're using LabVIEW (since this is the board you posted to). If you're using LabVIEW and you do have DLLs for your cards, you can use the Call Library Function Node or the Shared Library Import Wizard (which creates wrapper VIs for your DLL calls).
    Otherwise, you can use NI-VISA to communicate with your devices. Here is a tutorial how to configure a USB device using the VISA Driver Development Wizard (which would be analogous to Firewire), and here is an overview of VISA.
    You would read the data from device A and then write that data to device B, using either the DLLs or VISA, depending on which route you choose. Unless the devices have specific functions to transfer data to each other in their API, you will have to transfer the data by reading and writing the data in LabVIEW. I hope this helps!
    Regards,
    Missy S.
    Calibration Engineer
    National Instruments

  • I have a question about US/CDN app stores?

    I have several automatic app updates that can't be done becasue the error message says "my account is not valid in the US App store - I must switch to CDN first."
    The phone was bought in Canada??? How do I switch it to the CDN app store. There is no guidance.

    How to Change Your App Store Account Location | eHow

  • Questions about the sample DB

    I am using the Siebel 8.0 sample DB to do the lab.
    But there is no Application-Administration screen.
    Can anyone help me?
    Thanks.

    The other thing to check is the Responsibilities and Views.
    But yes, it's odd this doesn't work out of the box.
    On second thought, you will need the Adminstration Screen for that.
    As a last resort, read this post Linking Siebel Sample DB and SQL Server
    and see if you can query the tables to see if everything is in place.

  • Question about buying an app?

    So today I bought an app for $0.99. I'm still new with purchasing apps and I was wondering when you purchase an app, don't the app store usually tell you to put down your debit/credit card number & info? I completed downloading the app but it never told me to put in my debit card so I don't know if I paid for it or not? The last app I downloaded told me to give my debit card # but this time it did not. I'm using the Itouch 3rd Gen by the way.

    Once you enter in a credit or debit card, the iTunes Store will keep that information for future purchases, and it will remain there until you remove it.
    Regards.

Maybe you are looking for