Updates from Ullrich RSS Toggle Comment Threads | Keyboard Shortcuts

  • Ullrich 17:59 on 20. March 2012 Permalink | Reply
    Tags: , ,   

    Tabs Don’t you hate tabs I mean the… 

    Tabs… Don’t you hate tabs? I mean, the idea is nice, saving bytes and stuff. But the world isn’t ready for them yet.

    Here’s our Xcode indentation settings:

    And here are two lines of shell script that will help you clean up your already messed up code base :)

    find ./ -iname '*.[hcm]' -type f -exec gsed -i 's/\t/    /g' {} \;
    find ./ -iname '*.[hcm]' -type f -exec gsed -i '/^[ \t]*$/! { s/[ \t]*$//g }' {} \;

    What they’ll do is, 1st of all replacing all existing tabs by four spaces. The second command takes care of trailing whitespace (but not in lines that only contain whitespace), because we also hate that! :-D

    All that require the GNU version of sed. OSX ships with the BSD version, so you need to install it via

    brew install gnu-sed
     
  • Ullrich 19:49 on 13. March 2012 Permalink | Reply
    Tags: ,   

    Wrapping the tableView in a custom view in UITableViewController 

    Ever wanted to add a different view north of your table view without making it the tableHeaderView?

    Here’s what you need:

    @property (nonatomic, retain) UITableView *internalTableView;
    
    - (void)loadView;
    {
        [super loadView];
        self.internalTableView = self.tableView;
        self.view = [[[UIView alloc] initWithFrame:self.view.frame] autorelease];
        [self.view addSubview:self.tableView];
        self.tableView.frame = self.view.bounds;
    }
    
    - (void)viewDidUnload;
    {
        self.internalTableView = nil;
        [super viewDidUnload];
    }
    
    - (void)dealloc;
    {
        internalTableView = nil;
        [super dealloc];
    }
    
    // here's the finesse
    - (UITableView *)tableView;
    {
        if (!self.internalTableView) {
            return [super tableView];
        }
        return self.internalTableView;
    }
     
  • Ullrich 14:23 on 9. March 2012 Permalink | Reply
    Tags: git, ,   

    This is something I can never remember so… 

    This is something I can never remember, so why not create a small post about it.

    git tag -d v1.2.3
    git push origin :refs/tags/v1.2.3

    So what’s this… The first line is quite obviously deleting the tag from the local working tree. The second line deletes the tag from origin in the same way as you would delete a branch on origin, by pushing noting to it’s destination.

    To be complete here’s how you would delete a remote branch from origin:

    git push origin :my-branch
     
  • Ullrich 12:12 on 1. March 2012 Permalink | Reply
    Tags: , ,   

    Missing your opendiff? 

    Since I Xcode 4.3 the opendiff terminal command didn’t work any longer.

    Here’s how I fixed it:

    sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
     
  • Ullrich 13:05 on 15. February 2012 Permalink | Reply
    Tags: , , ,   

    AppStore validation error on app icons (-19007) 

    
    

    Since upgrading to OS X 10.7.3 you see this Xcode build warning?

    Icon specified in the Info.plist not found under the top level app wrapper: Icon-72.png (-19007)
    iPad: Icon.png: icon dimensions (57 x 57) don't meet the size requirements. The icon file must be 72x72 pixels, in .png format (-19014)

    This is going to turn into an validation error as soon as you try to upload a new build to the AppStore™.

    Here’s the fix:

    Install a new version of the Application Loader. The download link is hard to find (hard to google), so here’s one for version 2.5.1 (most current when writing this article).

    The most current version can be found under “Manage your applications” in iTunesConnect.

     
  • Ullrich 13:45 on 7. December 2011 Permalink | Reply
    Tags: , , ,   

    Remote Web Inspector Pt. 2 

    It gets even better, because this also works in Mobile Safari on the iOS 5 Simulator!

    Here’s a little script you can run, that enables the remote Web Inspector via gdb (via @atnan).

    Here’s to all the mobile devs!

     
  • Ullrich 13:07 on 7. December 2011 Permalink | Reply
    Tags: , ,   

    Remote Web Inspector 

    We recently stumbled across a blog post mentioning a way to enable a remote interface to a web inspector that is hidden inside the WebKit on iOS 5.

    Here’s how it’s done. In your Application Delegate add the following code:

    + (void)initialize;
    {
        [NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)];
    }

    With this you can direct your browser to http://localhost:9999 to open the web inspector.

    Have fun!

    	
     
    • Ullrich 13:51 on 7. December 2011 Permalink

      Remember that this will influence you’re App Store review experience ;)

  • Ullrich 18:26 on 27. September 2011 Permalink | Reply
    Tags: , ,   

    Symbolicating without Xcode 

    Ever wanted to symbolicate a incomplete crash file (i.e. the logs you get from TestFlight)?

    You can symbolicate individual addresses from the crashlog in the terminal using a command named `atos` (if you’ve got the dSYM file for your build). Here’s an example:

    atos -arch armv7 -o MyApp.app.dSYM/Contents/Resources/DWARF/MyApp 0x0000babe

    This will output you the line of code related to this address. I.e.:

    +[MyHappyClass fullOfFail] (in MyApp) + 429

    Pro Tip: not entering the address when calling the atos command leaves you in STDIN mode. Here you can add multiple addresses without restarting the tool.

     
  • Ullrich 11:31 on 24. March 2011 Permalink | Reply
    Tags: BTMM, ssh, ,   

    SSH and Back to My Mac 

    Ever wanted to ssh into your mac from a remote location? Here’s how:

    ssh [name of your mac].[mobile me username].members.mac.com

    If you have a dot in your username you can escape it by prefixnig it with \\. So if your hostname would be Mainbrain and your mobileMe username is jon.doe the terminal command would look as following:

    ssh mainbrain.jon\\.doe.members.mac.com
     
  • Ullrich 00:19 on 2. November 2010 Permalink | Reply
    Tags: Padrino, ruby, , zsh   

    A little off topic this time but here… 

    A little off topic this time, but here is a little script that adds padrino completion to your zshell.
    function _padrino () {
    	reply=( `padrino | awk '/padrino/ {print $2}'` )
    }
    compctl -K _padrino padrino
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel