Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [ios]

iOS is the mobile operating system running on the Apple iPhone, iPod touch, and iPad. Use this tag [ios] for questions related to programming on the iOS platform. Use the related tags [objective-c] and [swift] for issues specific to those programming languages.

2341 votes
51 answers
768k views

Vertically align text to top within a UILabel

I have a UILabel with space for two lines of text. Sometimes, when the text is too short, this text is displayed in the vertical center of the label. How do I vertically align the text to always be ...
Stefan's user avatar
  • 28.9k
1948 votes
28 answers
536k views

What's the difference between the atomic and nonatomic attributes?

What do atomic and nonatomic mean in property declarations? @property(nonatomic, retain) UITextField *userName; @property(atomic, retain) UITextField *userName; @property(retain) UITextField *...
Alex Wayne's user avatar
  • 185k
1792 votes
98 answers
654k views

How can I make a UITextField move up when the keyboard is present - on starting to edit?

With the iOS SDK: I have a UIView with UITextFields that bring 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 ...
1614 votes
29 answers
710k views

Using Auto Layout in UITableView for dynamic cell layouts & variable row heights

How do you use Auto Layout within UITableViewCells in a table view to let each cell's content and subviews determine the row height (itself/automatically), while maintaining smooth scrolling ...
smileyborg's user avatar
  • 30.4k
1606 votes
30 answers
969k views

Transport security has blocked a cleartext HTTP

What setting do I need to put in my info.plist to enable HTTP mode as per the following error message? Transport security has blocked a cleartext HTTP (http://) resource load since it is insecure....
Jeef's user avatar
  • 27.2k
1500 votes
44 answers
525k 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 ...
Matt Price's user avatar
  • 34.6k
1408 votes
39 answers
515k views

How can I check for an active Internet connection on iOS or macOS?

I would like to check to see if I have an Internet connection on iOS using the Cocoa Touch libraries or on macOS using the Cocoa libraries. I came up with a way to do this using an NSURL. The way I ...
Brock Woolf's user avatar
  • 47.1k
1324 votes
27 answers
486k 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 ...
rustyshelf's user avatar
  • 45.1k
1323 votes
82 answers
1.0m views

Xcode - How to fix 'NSUnknownKeyException', Reason: "… this class is not key value coding-compliant for the key X" error?

I'm trying to link a UILabel with an IBOutlet created in my class. My application is crashing with the following error" *** Terminating app due to uncaught exception 'NSUnknownKeyException', ...
1302 votes
19 answers
192k views

performSelector may cause a leak because its selector is unknown

I'm getting the following warning by the ARC compiler: "performSelector may cause a leak because its selector is unknown". Here's what I'm doing: [_controller performSelector:NSSelectorFromString(@"...
Eduardo Scoz's user avatar
  • 24.7k
1281 votes
21 answers
588k views

How do I check if a string contains another string in Objective-C?

How can I check if a string (NSString) contains another smaller string? I was hoping for something like: NSString *string = @"hello bla bla"; NSLog(@"%d",[string containsSubstring:@"hello"]); But ...
Jonathan.'s user avatar
  • 55.2k
1277 votes
42 answers
543k views

How can I disable the UITableView selection?

When you tap a row in a UITableView, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?
davidmytton's user avatar
  • 39.1k
1269 votes
43 answers
1.1m views

How can I develop for iPhone using a Windows development machine?

Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows? The only other way I can think of doing this is to run a Mac VM image on a ...
1160 votes
37 answers
579k views

How can I change the name of an iOS app in Xcode?

I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished. How can I do this?
Robert Gould's user avatar
  • 69.5k
1088 votes
62 answers
674k views

How to change Status Bar text color in iOS

My application has a dark background, but in iOS 7 the status bar became transparent. So I can't see anything there, only the green battery indicator in the corner. How can I change the status bar ...
Oleksandr Veremchuk's user avatar

15 30 50 per page
1
2 3 4 5
45897