Help with properties accessor/getter methods

Discussion in 'iOS Programming' started by bleer, Aug 18, 2008.

  1. bleer macrumors newbie

    Joined:
    Jul 16, 2008
    #1
    Hey,

    So i have defined a class to extend some other class and i added custom properties for it, say

    @interface class:uiclass{

    int a;
    }

    @property(nonatomic,assign) a;

    then I synthesize in the implementation....using the accessor and getter methods in the actual class work fine, but now im trying to define an instance of this class in some other class and when i try to use the getter or setter methods for the class the application crashes...what am i doing wrong?

    Thanks
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    When you say "use the getter or setter methods for the class the application crashes" you mean on an instance of the class right? The property along with it's accessor methods are instance, not class level.
     
  3. bleer thread starter macrumors newbie

    Joined:
    Jul 16, 2008
    #3
    Yes after it has been initialized
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Can you post the code that is causing the crash (including the object creation and initialisation). There is no reason that this should crash!
     
  5. bleer thread starter macrumors newbie

    Joined:
    Jul 16, 2008
    #5
    I think I know what's happening I'll post back ifmy issue isn't resolved..
     

Share This Page