0

Building for armv6 in Xcode 4.5

-

The original iPhone, iPhone 3G, and first two generations of iPod touch used processors supporting the armv6 instruction set. However, with the iPhone 3GS, Apple moved to the more modern, but backwards compatible, armv7 instruction set, and the iPhone 5 includes armv7s. To support older devices while taking advantage of the capabilities of the newer processors, iOS supports fat binaries, which are multiple executables, each for a separate instruction set, combined into one.

(more...)

0

Converting iPhone xib to iPad xib?

-

I was able to narrow it down to a few things, so here are the steps that worked for me:

1) Make a copy of the iPhone xib file and add it to your project

2) Right click the file (in xcode) and Open As > Source Code

3) The 2nd line should look like:

<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">

Replace with:

<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">

4) Search for "IBCocoaTouchFramework" and Replace all occurrences with "IBIPadFramework"
5) Save the file and Open As > Interface Builder - iOS

The file might still look like a regular iPhone xib, but for me, once I changed the Status Bar to "Black" in the Attributes inspector the rest of the xib just kind of "snapped" into an iPad xib

0

NSInvocation alternative for performSelector:

-

This code doesn’t involve compiler flags or direct runtime calls:

 

  1. SEL selector = @selector(zeroArgumentMethod);
  2. NSMethodSignature *methodSig = [[self class] instanceMethodSignatureForSelector:selector];
  3. NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSig];
  4. [invocation setSelector:selector];
  5. [invocation setTarget:self];
  6. [invocation invoke];
SEL selector = @selector(zeroArgumentMethod);
NSMethodSignature *methodSig = [[self class] instanceMethodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSig];
[invocation setSelector:selector];
[invocation setTarget:self];
[invocation invoke];


Resource
NSInvocation allows multiple arguments to be set so unlike performSelector this will work on any method.

And tip:

  1. #pragma clang diagnostic push
  2. #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
  3.     [self.ticketTarget performSelector: self.ticketAction withObject: self];
  4. #pragma clang diagnostic pop
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    [self.ticketTarget performSelector: self.ticketAction withObject: self];
#pragma clang diagnostic pop

 

0

EBPurchase for iOS

-

EBPurchase adds simple In-App Purchase functionality to your iOS app. It wraps all of the necessary code for interacting with the StoreKit framework into a convenient little class, and provides you with easy-to-use methods. EBPurchase is non-ARC and has been tested to work with iOS 4.3 and higher.

Full

GitHub link

0

Three useful UIWebView tweaks

-

It is a well known fact among iOS developers that creating screens with complicated formatted text is a hassle. UILabel, UITextView, and friends are not really designed for that purpose. The alternative that is often used to overcome those limitations is the versatile UIWebView combined with some local HTML content and CSS styling.

But the UIWebView itself comes with strings attached. In this post we are going to share three small tips that might help in making the UIWebView look more integrated with the rest of your UI.

(more...)

0

MapKit on iOS

-

MapKit is a really neat API available on the iPhone that makes it easy to display maps, jump to coordinates, plot locations, and even draw routes and other shapes on top.

I’m writing this tutorial because about a month ago I attended a neat event in Baltimore called Civic Hack Day where I played around with MapKit to display some public data such as place locations, crime data, arrests and bus routes. It was kind of fun so thought others might be interested to learn how it works – and maybe use a similar technique with data from your own hometown!

In this tutorial, we’re going to make an app that zoomes into aparticularly cool location in Baltimore. The app will then query a Baltimore web service to pull back the recent arrests around that area, and plot them on the map.

(more...)

1 2 3 4 5 6 7 8 9 10 »