Updates from Ullrich RSS Toggle Comment Threads | Keyboard Shortcuts

  • 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
     
  • Ullrich 09:14 on 14. October 2010 Permalink | Reply
    Tags: , , , ,   

    Colliding Category Methods 

    After multiple years of Objective-C experience yesterday was the first time that we actually ran into problems with colliding methods in categories.

    Here’s the story (you may skip this part): The issue was, that we added a method -setParameters: to NSMutableURLRequest which takes a dictionary and set’s it as query string or multipart form body depending on the HTTP Method used for sending the request. This method sadly conflicted with a category on the same class defined in a library called OAuthConsumer which doesn’t take a dictionary as argument but rather an array of key-value pairs. Both categories we’re linked to our application as static libraries.

    The result was that our -setParameters: was called with an array although a dictionary was expected. We noticed the problem since NSArray is not responding to -allKeys. It could have gone would have not noticed the problem. Just imagine trying to debug a misbehavior when you’re looking at the wrong piece of code.

    The quintessence, and what basically helped us finding the issue is a environment variable named OBJC_PRINT_REPLACED_METHODS. Similar to NSZombieEnabled you set it in the Arguments tab of your executable info as variable set to environment. Just like this:

     
  • Ullrich 15:27 on 27. September 2010 Permalink | Reply
    Tags: , ,   

    Zombies 

    Everyone should know the NSZombieEnabled environment variable. Set it to YES to temporarily disable deallocation of objects which reach a retain count of zero. You then can set breakpoints to common methods such as:

    fb -[_NSZombie init]
    fb -[_NSZombie retainCount]
    fb -[_NSZombie retain]
    fb -[_NSZombie release]
    fb -[_NSZombie autorelease]
    fb -[_NSZombie methodSignatureForSelector:]
    fb -[_NSZombie respondsToSelector:]
    fb -[_NSZombie forwardInvocation:]
    fb -[_NSZombie class]
    fb -[_NSZombie dealloc]

    But you should also know that this only works on NS classes. To have a similar effect on CoreFoundation classes use CFZombieLevel. The value of CFZombieLevel is defined by a bit array. See the following table. A good value is 5 :)

    Bit	Action
    0	scribble deallocated CF memory
    1	when scribbling deallocated CF memory, don't scribble object header (CFRuntimeBase)
    4	never free memory used to hold CF objects
    7	if set, scribble deallocations using bits 8..15, otherwise use 0xFC
    8..15	if bit 7 is set, scribble deallocations using this value
    16	scribble allocated CF memory
    23	if set, scribble allocations using bits 24..31, otherwise use 0xCF
    24..31	if bit 16 is set, scribble allocations using this value
     
  • Ullrich 15:57 on 1. September 2010 Permalink | Reply
    Tags: , Framework, Mac, ,   

    Embedded Frameworks 

    When embedding frameworks to your Mac app there might be problems of finding a header file. There are three things to check for:

    • The framework needs to have @executable_path/../Frameworks as Installation Directory in it’s build settings.
    • The app should include the following in its framework search path: “$(CONFIGURATION_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/Frameworks” (including the quotes!)
    • Also make sure to have a Copy Frameworks build phase and that your famework is added to it.
     
    • Ullrich 16:24 on 13. September 2010 Permalink

      When you’re importing the header files make sure to import them “framework style”:

      #import <TheFramework/TheHeader.h>

      If you still can’t find your framework headers make sure your target is actually linked against them.

  • Ullrich 14:31 on 3. June 2010 Permalink | Reply
    Tags:   

    Finder Toolbar Items 

    Did you know that you can add applications to your Finder toolbar? This comes in as a very handy shortcut because you can add context aware action scripts that do common stuff for you. Today I’m sharing 3 of them that help me through my days. :)

    • OpenInGitX  - This opens GitX with the currently opened folder. (Also make sure to check out brotherbard’s experimental GitX fork)
    • OpenInTextMate – As it says, it opens the currently selected files (or if non selected the currently opened folders) in TextMate.
    • OpenTerminalHere – This is the most useful. It opens Terminal.app with the current folder.

    You can download them here. It’s a good idea to extract them into your applications folder like so:

    To add them to your toolbar simple drag them there. That’s how my toolbar looks:

    The scripts/applications are based on this post but have been modified slightly. Let me know if you like’em :)

     
    • Emmanuel Paraskakis 14:32 on 7. August 2010 Permalink

      Just what I was looking for – Thanks!

    • Kim Thostrup 23:40 on 11. January 2011 Permalink

      Perfect, thanks.

    • Miro 17:50 on 12. May 2011 Permalink

      Hello,
      thank you for the great scripts, I found a little bug in the OpenGitX here script, when you try to apply it to the folder with a spaces in the name, so I fixed it by changing this line to:
      do shell script “screen -dmS git-gui-droplet bash -c \”cd ” & listOfAliases & “; /usr/local/bin/gitx\”"

      Hope this will help lots of people :)

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