All Questions

100
votes
10answers
21186 views

When to use -retainCount?

I would like to know in what situation did you use -retainCount so far, and eventually the problems that can happen using it. Thanks.
355
votes
9answers
78174 views

How dangerous is it to compare floating point values?

I know UIKit uses CGFloat because of the resolution independent coordinate system. But every time I want to check if for example frame.origin.x is 0 it makes me feel sick: if (theView.frame.origin.x...
11
votes
3answers
2242 views

Getting date from [NSDate date] off by a few hours

I am using NSDate *date = [NSDate date]; for getting the date, but the date I get is off by 2 hours.
351
votes
29answers
186504 views

Determine device (iPhone, iPod Touch) with iPhone SDK

Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch, if possible.
236
votes
25answers
122950 views

How to force NSLocalizedString to use a specific language

On iPhone NSLocalizedString returns the string in the language of the iPhone. Is it possible to force NSLocalizedString to use a specific language to have the app in a different language than the devi...
601
votes
26answers
260888 views

Location Services not working in iOS 8

My app that worked fine on iOS 7 doesn't work with the iOS 8 SDK. CLLocationManager doesn't return a location, and I don't see my app under Settings -> Location Services either. I did a Goo...
180
votes
12answers
72319 views

What's the Best Way to Shuffle an NSMutableArray?

If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better wa...
452
votes
7answers
103819 views

How do I set up NSZombieEnabled in Xcode 4?

How do I set up NSZombieEnabled and CFZombieLevel for my executable in Xcode 4?
239
votes
7answers
119671 views

How to store custom objects in NSUserDefaults

Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to t...
421
votes
18answers
291985 views

What is the difference between class and instance methods?

What's the difference between a class method and an instance method? Are instance methods the accessors (getters and setters) while class methods are pretty much everything else?

Previous Next