2
votes

I recently have been working on a project that has a xib file that contains a UIView w/ a UIScrollView inside of it. There is a long list of content within the UIScrollView, and I have noticed a significant decrease in speed while working in the Interface Builder.

All other files work fine and working with the Interface Builder with other files works perfectly. It is only this specific xib file that causes a lag of about 5 seconds after making even basic changes like clicking on a UILabel. I expect that the problem is caused by the amount of objects in the main UIView's UIScrollView.

I first tried restarting everything and then tried the suggestions from this thread: Xcode 4 - slow performance

None of them solved the issue. I have never had a similar problem before. Has anyone dealt with this kind of issue before and solved it?

I have a Late 2011 Macbook Pro w/ a 2.4GHz Intel Core i5 processor and 16GB of RAM.

3
Have you tried creating another xib with a bunch of views? One sample is not sample... :) If this is reproducible, then IB cannot handle that many objects at the same time. If other xibs work, then you should restart the problematic on from scratch (I can imagine somehting got broken in the source XML) - allprog

3 Answers

1
votes

While the .xib is in Interface Builder, go under the File Inspector tab and disable auto-layout for the .xib, then when you're done, re-enable auto-layout for the .xib and add constraints.

Also answered here: other stackoverflow question

1
votes

For what's worth. I also had major performance issues with the new Xcode. Slow slower slowest.

I did 2 thing disabled indexing en forced stopped IB.

Disable indexing:

On the command line give the command:

defaults write com.apple.dt.XCode IDEIndexDisable 1

After this, Xode runs good. Although code completion etc will not work. If you want you can turn it on again with:

defaults delete com.apple.dt.XCode IDEIndexDisable

Force stop of Interface Builder

I found this one by surprise. During one of those awfull moments when IB was doing something / nothing or whatever, I forced stopped Xcode.

Press Alt+Cmd

Select Xcode and press force stop

After that IB runned smoothly!

0
votes

It is something related to auto layout. Not sure exactly what it is.

My problem was on particular xib. When cancelling auto layout for that xib performance is smooth. As soon as I turn it on and put constraints on my scroll view (0 margins to all sides), it goes laggy again.

What solved the lags for me was to set navigation bar appearance in interface builder to none (Was opaque).

Strange thing is, it happens only on my Mac Book air 13'. My iMac runs this exact same file smoothly. Not sure if it has something with the hardware or not.