iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

iOS 4 app crashes at startup on iOS 3.1.3: Symbol not found: __NSConcreteStackBlock

I’m running Xcode 3.2.3 with the iOS 4.0 SDK. I built my app with Base SDK = iphoneos4.0, Active SDK = iphoneos4.0, Deployment Target = 3.1.3, and Architecture = standard (arm6 arm7). Compiler = GCC 4.2. As I understand it, this is the correct way to build an app for both iOS 4 and 3. […]

Save custom objects into NSUserDefaults

This question already has an answer here: Saving custom SWIFT class with NSCoding to UserDefaults 7 answers

Replacement for C-style loop in Swift 2.2

Swift 2.2 deprecated the C-style loop. However in some cases, the new range operator just doesn’t work the same. for var i = 0; i < -1; ++i { … } and for i in 0..<-1 { … } The later one will fail at run-time. I can wrap the loop with an if, but […]

Change tab bar item selected color in a storyboard

I want to change my tab bar items to be pink when selected instead of the default blue. How can i accomplish this using the storyboard editor in Xcode 6? Here are my current setting which are not working, the blue background works but the pink doesnt work:

Why shouldn't I use the getter to release a property in objective-c?

I was told by a fellow StackOverflow user that I should not use the getter method when releasing a property: @property(nonatmic, retain) Type* variable; @synthesize variable; // wrong [self.variable release]; // right [variable release]; He did not explain in detail why. They appear the same to me. My iOS book said the getter on a […]

How to flip an individual UIView (without flipping the parent view)

This is an iPad project where I have a UIView with several subViews, and I am trying to animate one of this UIViews using [UIView transitionFromView:toView:duration:options:completion], but when I run this method the whole parent view gets flipped! This is the code I’m using: UIView *secondView = [[UIView alloc] initWithFrame:CGRectMake(200, 200, 300, 300)]; [newView setBackgroundColor:[UIColor […]

How to draw a custom UIView that is just a circle – iPhone app

How would I go about drawing a custom UIView that is literally just a ball (a 2D circle)? Would I just override the drawRect method? And can someone show me the code for drawing a blue circle? Also, would it be okay to change the frame of that view within the class itself? Or do […]

Getting user location every n minutes after app goes to background

I am trying to implement the suggestions given in this post. Unfortunately the steps are not clear to me. I tried implementing those suggestions, but the backgroundTimeRemaining continues to decrease even after I start and stop locationServices. This is how I developed it: – (void)applicationDidEnterBackground:(UIApplication *)application { UIApplication* app = [UIApplication sharedApplication]; bgTask = [app […]

this class is not key value coding-compliant for the key view

This question already has an answer here: What does this mean? “'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X” 63 answers

How do you make a background image scale to screen size in swift?

I’m trying to make a UIView image for my background in swift using pattern image. The code I have works well except for the fact that I want the image to take the whole screen. My code looks like this: self.view.backgroundColor = UIColor(patternImage: UIImage(named: “backgroundImage”)!) Does anyone know how to make the background an image […]