Using outlets more than once

Discussion in 'iOS Programming' started by eggroll, Mar 26, 2010.

  1. eggroll macrumors newbie

    Joined:
    Mar 26, 2010
    #1
    Hello, I am a beginner with xcode. In the app that I am currently developing I am using a lot of UIImageViews. I need an outlet that would be used for all of the images. When I made it an outlet for the class, it doesn't work. Even when I do that, some of the images that I don't want the outlet assigned to get the outlet. This may be a very bad question, but I need help with this. Thank you.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    An outlet can be connected to one object at once in Interface Builder.

    If the number of objects is unknown then I'd do it all in code and not use Interface Builder...
     
  3. eggroll thread starter macrumors newbie

    Joined:
    Mar 26, 2010
    #3
    so if I don't use outlets, how do I do 'CGRectIntersectsRect'?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    What does that have to do with interface builder outlets? You'd still have references to the objects in variables: you'd just create them in code and store them in an NSArray or something similar.
     
  5. eggroll thread starter macrumors newbie

    Joined:
    Mar 26, 2010
    #5
    can you please give me an example I'm sort of confused. and does it make a difference if you keep using the same image
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Given that I barely understand what you are trying to do, no, I can't really give you an example.

    What I am suggesting is that instead of creating image views in Interface Builder you create them in your code and store the references somewhere for later use.
     

Share This Page