All Questions

1100
votes
35answers
382919 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...
1440
votes
84answers
557286 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...
334
votes
26answers
180738 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 ...
1096
votes
22answers
419616 views

How to 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, let's say they are 'Person' objects. I want to sort the NSMutableArray by Person.bi...
727
votes
12answers
212254 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...
657
votes
18answers
295898 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?
1251
votes
18answers
313042 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...
135
votes
4answers
34553 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...
97
votes
10answers
20914 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.
722
votes
36answers
377775 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 >...

Previous Next