Skip to content

Instantly share code, notes, and snippets.

@dcloud
dcloud / mapbox_autolayout_upgrade
Created January 28, 2014 18:14
mapbox upgrade creates autolayout issue
0xcc7ab20 V:[UIImageView:0xe1d0b00]-(3)-[_UILayoutGuide:0xcc9a270]>
When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.
2014-01-28 13:09:02.400 Congress[15314:70b] View hierarchy unprepared for constraint.
Constraint: <NSLayoutConstraint:0xcc7ab20 V:[UIImageView:0xe1d0b00]-(3)-[_UILayoutGuide:0xcc9a270]>
Container hierarchy:
MapView at {0,0}-{320x548}
| <RMLoadingTileView: 0xe1ccec0; baseClass = UIScrollView; frame = (0 0; 320 548); clipsToBounds = YES; userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0xe1cd380>; layer = <CALayer: 0xe1cd100>; contentOffset: {320, 548}>
| | <UIView: 0xe1cd550; frame = (0 0; 960 1644); layer = <CALayer: 0xe1cd5b0>>
| <RMMapScrollView: 0xcf51b90; baseClass = UIScrollView; frame = (0 0; 320 548); opaque = NO; gestureRecognizers = <NSArray: 0xcf4e
@dcloud
dcloud / xcode-git-version.sh
Created February 6, 2013 22:08
My simple version of using git commit count to set build numbers in Xcode.
#!/bin/sh
#
git=`sh /etc/profile; which git`
count=`$git rev-list --all | wc -l`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $count" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@dcloud
dcloud / ImageLoader.as
Created October 25, 2010 20:58
Example of using Loader class to load images, plus some stuff on tracing items in a DisplayObjectContainer's display list.
package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.*;
public class ImageLoader extends Sprite
{
private var _ldr:Loader;
private var _urlReq:URLRequest;