Question

Hi Wonder if someone can help me please.

I have a view controller. This is linked up to my viewcontroller class all ok.

Within the main view i have 3 subviews. I want to set borders etc on these 3 subviews. So i created a IBOutletCollection and wired them all up. No problem. The borders took effect and all was ok.

I then went and changed the background color of each of these 3 views via the storyboard GUI editor and re-run the program now i keep getting signal sigabrt exceptions. Iv put breakpoints on the border setting code and it doesnt even reach there. If i remove the links to my iboutletcollection then it runs no problem.

I cant understand why its decided to stop working when 3 mins ago everything was fine. Iv turned the color back and still same problem. I guess im going to have to use 3 iboutlets and set each of their borders etc individually. Unless someone can advise.

My collection i use is:

@property (retain, nonatomic) IBOutletCollection(UIView) NSMutableSet* <NAME>;

Im connecting them up and setting the background color via the storyboard GUI editor. The ONLY change i made between it working as i wanted and it beginning to throw exceptions was change the background colors via the GUI editor.

Thanks in advance

Était-ce utile?

La solution

Apple's documentation (scroll down to the bottom) on IBOutletCollection states:

You can insert this macro only in front of variables typed as NSArray or NSMutableArray.

So change the type from NSMutableSet * to NSMutableArray *.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top