All Questions

1123
votes
35answers
390571 views

Passing Data between View Controllers

I'm new to iOS and, Objective-C and the whole MVC paradigm and I'm stuck with the following: I have a view that acts as a data entry form and I want to give the user the option to select multiple pro...
1480
votes
85answers
567286 views

How to make a UITextField move up when keyboard is present?

With the iPhone SDK: I have a UIView with UITextFields that brings up a keyboard. I need it to be able to: Allow scrolling of the contents of the UIScrollView to see the other text fields once the...
747
votes
12answers
218055 views

How to call Objective-C code from Swift

In the new Swift language from Apple, how does one call Objective-C code? Apple mentioned that they could co-exist in one application, but does this mean that one could technically re-use old classes...
334
votes
26answers
180957 views

What should my Objective-C singleton look like?

My singleton accessor method is usually some variant of: static MyClass *gInstance = NULL; + (MyClass *)instance { @synchronized(self) { if (gInstance == NULL) gInstance ...
1114
votes
22answers
423586 views

How do I sort an NSMutableArray with custom objects in it?

What I want to do seems pretty simple, but I can't find any answers on the web. I have an NSMutableArray of objects, and let's say they are 'Person' objects. I want to sort the NSMutableArray by Perso...
663
votes
18answers
300773 views

How do I create delegates in Objective-C?

I know how delegates work, and I know how I can use them. But how do I create them?
1261
votes
18answers
315043 views

How can I disable ARC for a single file in a project?

I am using ARC successfully in my project. However, I have encountered a few files (e.g., in unit tests and mock objects) where the rules of ARC are a little more fragile right now. I recall hearing t...
137
votes
4answers
35098 views

What is the best way to deal with the NSDateFormatter locale "feechur"?

It seems that NSDateFormatter has a "feature" that bites you unexpectedly: If you do a simple "fixed" format operation such as: NSDateFormatter* fmt = [[NSDateFormatter alloc] init]; [fmt setDateFor...
737
votes
36answers
386233 views

How to check iOS version?

I want to check if the iOS version of the device is greater than 3.1.3 I tried things like: [[UIDevice currentDevice].systemVersion floatValue] but it does not work, I just want a: if (version >...
100
votes
10answers
21098 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.

Previous Next