1

This is somewhat an attendant question to Do I need to release xib resources?

If I have added a static UIView (for example an UILabel that doesn't change) do I need to release it?

Since I'm not going the edit the UIView I haven't created any connection, @property or @synthesize.

Do I still need to create this in order to connect it in my IB and release it? That does seem like strange logic. But I want to be certain that this is not the case.

Community
  • 1
  • 1
Man of One Way
  • 3,904
  • 1
  • 26
  • 41

2 Answers2

2

No you needn't release it unless you have a property retain. You send release message to decrement the object count and in your case it is not necessary.

Praveen S
  • 10,355
  • 2
  • 43
  • 69
1

No, I'm pretty sure you don't have to release xib resources you don't have an outlet for. When you create an outlet, it might look like this

@property (nonatomic, retain) IBOutlet UIView *myView;

The retain bit is the important bit in there. That's why you have to release it. You shouldn't have to for things you don't have an outlet for.

Alex Coplan
  • 13,211
  • 19
  • 77
  • 138