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.
            74,437
            questions
        
        
            1500
            votes
        
        
            44
            answers
        
        
            524k
            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 ...
            
        
       
    
            1322
            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', ...
            
        
       
    
            113
            votes
        
        
            13
            answers
        
        
            89k
            views
        
    Returning data from async call in Swift function
                I have created a utility class in my Swift project that handles all the REST requests and responses. I have built a simple REST API so I can test my code. I have created a class method that needs to ...
            
        
       
    
            1614
            votes
        
        
            29
            answers
        
        
            708k
            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 ...
            
        
       
    
            111
            votes
        
        
            1
            answer
        
        
            31k
            views
        
    Speed up fetching posts for my social network app by using query instead of observing a single event repeatedly
                I have an array of keys which lead to post objects for my social network like so /posts/id/(post info)
When I load the posts I load /posts/0 and then /posts/1 etc using the observeSingleEventOfType(....
            
        
       
    
            1601
            votes
        
        
            30
            answers
        
        
            959k
            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....
            
        
       
    
            606
            votes
        
        
            6
            answers
        
        
            240k
            views
        
    What are Unwind segues for and how do you use them?
                iOS 6 and Xcode 4.5 has a new feature referred to as "Unwind Segue":
  Unwind segues can allow transitioning to existing instances of scenes in a storyboard
In addition to this brief entry in Xcode ...
            
        
       
    
            1792
            votes
        
        
            99
            answers
        
        
            652k
            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 ...
            
        
       
    
            1406
            votes
        
        
            39
            answers
        
        
            512k
            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 ...
            
        
       
    
            1325
            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 ...
            
        
       
    
            774
            votes
        
        
            20
            answers
        
        
            385k
            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?
            
        
       
    
            521
            votes
        
        
            39
            answers
        
        
            751k
            views
        
    Loading/Downloading image from URL on Swift
                I'd like to load an image from a URL in my application, so I first tried with Objective-C and it worked, however, with Swift, I've a compilation error:
'imageWithData' is unavailable: use object ...
            
        
       
    
            448
            votes
        
        
            26
            answers
        
        
            252k
            views
        
    Symbolicating iPhone App Crash Reports
                I'm looking to try and symbolicate my iPhone app's crash reports.
I retrieved the crash reports from iTunes Connect. I have the application binary that I submitted to the App Store and I have the ...
            
        
       
    
            504
            votes
        
        
            30
            answers
        
        
            150k
            views
        
    How to develop or migrate apps for iPhone 5 screen resolution?
                The new iPhone 5 display has a new aspect ratio and a new resolution (640 x 1136 pixels).
What is required to develop new or transition already existing applications to the new screen size?
What ...
            
        
       
    
            174
            votes
        
        
            4
            answers
        
        
            49k
            views
        
    What is the best way to deal with the NSDateFormatter locale "feature"?
                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] ...
            
        
       
    
            52
            votes
        
        
            3
            answers
        
        
            34k
            views
        
    How to add Exception Breakpoint in Xcode?
                How to add Exception Breakpoint in Xcode?
int main(int argc, char *argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @"...
            
        
       
    
            1270
            votes
        
        
            42
            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 ...
            
        
       
    
            511
            votes
        
        
            31
            answers
        
        
            166k
            views
        
    UIDevice uniqueIdentifier deprecated - What to do now?
                It has just come to light that the UIDevice uniqueIdentifier property is deprecated in iOS 5 and unavailable in iOS 7 and above. No alternative method or property appears to be available or ...
            
        
       
    
            468
            votes
        
        
            8
            answers
        
        
            446k
            views
        
    How do I load an HTTP URL with App Transport Security enabled in iOS 9? [duplicate]
                So, the new beta SDK of iOS released last night has "App Transport Security" which encourages developers to use https instead of http. In principle, this is a great idea, and I already use https in ...
            
        
       
    
            1947
            votes
        
        
            28
            answers
        
        
            534k
            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 *...
            
        
       
    
            422
            votes
        
        
            12
            answers
        
        
            101k
            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 ...
            
        
       
    
            390
            votes
        
        
            21
            answers
        
        
            361k
            views
        
    Swift - encode URL
                If I encode a string like this: 
var escapedString = originalString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)
it doesn't escape the slashes /. 
I've searched and found this ...
            
        
       
    
            909
            votes
        
        
            36
            answers
        
        
            531k
            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 > ...
            
        
       
    
            792
            votes
        
        
            32
            answers
        
        
            241k
            views
        
    Can I embed a custom font in an iPhone application?
                I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible?
            
        
       
    
            330
            votes
        
        
            5
            answers
        
        
            133k
            views
        
    How do I associate file types with an iPhone application?
                On the subject of associating your iPhone app with file types.
In this informative question I learned that apps could be associated with custom URL protocols. 
That was almost one year ago and since ...
            
        
       
    
            649
            votes
        
        
            28
            answers
        
        
            345k
            views
        
    Presenting modal in iOS 13 fullscreen
                In iOS 13 there is a new behaviour for modal view controller when being presented.
Now it's not fullscreen by default and when I try to slide down, the app just dismiss the View Controller ...
            
        
       
    
            274
            votes
        
        
            28
            answers
        
        
            161k
            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 ...
            
        
       
    
            550
            votes
        
        
            32
            answers
        
        
            411k
            views
        
    How to determine the current iPhone/device model?
                Is there a way to get the device model name (iPhone 4S, iPhone 5, iPhone 5S, etc) in Swift?
I know there is a property named UIDevice.currentDevice().model but it only returns device type (iPod touch,...
            
        
       
    
            360
            votes
        
        
            10
            answers
        
        
            357k
            views
        
    How to pass prepareForSegue: an object
                I have many annotations in a mapview (with rightCalloutAccessory buttons). The button will perform a segue from this mapview to a tableview.  I want to pass the tableview a different object (that ...
            
        
       
    
            376
            votes
        
        
            31
            answers
        
        
            199k
            views
        
    Determine device (iPhone, iPod Touch) with iOS
                Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch, if possible.
            
        
       
    
            434
            votes
        
        
            11
            answers
        
        
            412k
            views
        
    Test iOS app on device without apple developer program or jailbreak
                How can I test an iOS application on my iPod Touch without registering for the Apple Developer Program or jailbreaking my iPod?
Neither is a viable option at the moment.
I'd like to test on the ...
            
        
       
    
            104
            votes
        
        
            9
            answers
        
        
            97k
            views
        
    How can I debug 'unrecognized selector sent to instance' error
                I am creating a custom table cell view for my table view. After I connect an image view of custom cell (in storyboard) to my code in swift, I get the following error.
[UITableViewCellContentView ...
            
        
       
    
            1087
            votes
        
        
            61
            answers
        
        
            672k
            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 ...
            
        
       
    
            339
            votes
        
        
            9
            answers
        
        
            236k
            views
        
    Programmatically get own phone number in iOS
                Is there any way to get own phone number by standard APIs from iPhone SDK?
            
        
       
    
            275
            votes
        
        
            7
            answers
        
        
            143k
            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 ...
            
        
       
    
            442
            votes
        
        
            33
            answers
        
        
            381k
            views
        
    The simplest way to resize an UIImage?
                In my iPhone app, I take a picture with the camera, then I want to resize it to 290*390 pixels. I was using this method to resize the image :  
UIImage *newImage = [image _imageScaledToSize:...
            
        
       
    
            321
            votes
        
        
            40
            answers
        
        
            390k
            views
        
    Undefined symbols for architecture armv7
                This problem has been driving me crazy, and I can't work out how to fix it...
    Undefined symbols for architecture armv7:
  "_deflateEnd", referenced from:
      -[ASIDataCompressor closeStream] in ...
            
        
       
    
            565
            votes
        
        
            41
            answers
        
        
            431k
            views
        
    How do I size a UITextView to its content?
                Is there a good way to adjust the size of a UITextView to conform to its content? Say for instance I have a UITextView that contains one line of text:
"Hello world"
I then add another line of text:
...
            
        
       
    
            119
            votes
        
        
            20
            answers
        
        
            162k
            views
        
    How to get the indexpath.row when an element is activated?
                I have a tableview with buttons and I want to use the indexpath.row when one of them is tapped.
This is what I currently have, but it always is 0
var point = Int()
func buttonPressed(sender: ...
            
        
       
    
            236
            votes
        
        
            19
            answers
        
        
            137k
            views
        
    How do I do base64 encoding on iOS?
                I'd like to do base64 encoding and decoding, but I could not find any support from the iPhone SDK. How can I do base64 encoding and decoding with or without a library?
            
        
       
    
            228
            votes
        
        
            0
            answers
        
        
            315k
            views
        
    iPhone development on Windows [duplicate]
                Possible Duplicate:
  How can I develop for iPhone using a Windows development machine?  
Is there a way to develop iPhone (iOS) applications on Windows?  I really don't want to get yet another ...
            
        
       
    
            329
            votes
        
        
            11
            answers
        
        
            269k
            views
        
    Looking to understand the iOS UIViewController lifecycle
                Could you explain me the correct manner to manage the UIViewController lifecycle?
In particular, I would like to know how to use Initialize, ViewDidLoad, ViewWillAppear, ViewDidAppear, ...
            
        
       
    
            633
            votes
        
        
            6
            answers
        
        
            415k
            views
        
    Send and receive messages through NSNotificationCenter in Objective-C?
                I am attempting to send and receive messages through NSNotificationCenter in Objective-C. However, I haven't been able to find any examples on how to do this. How do you send and receive messages ...
            
        
       
    
            1048
            votes
        
        
            14
            answers
        
        
            447k
            views
        
    Constants in Objective-C
                I'm developing a Cocoa application, and I'm using constant NSStrings as ways to store key names for my preferences.
I understand this is a good idea because it allows easy changing of keys if ...
            
        
       
    
            568
            votes
        
        
            19
            answers
        
        
            692k
            views
        
    How to add constraints programmatically using Swift
                I'm trying to figure this out since last week without going any step further. Ok, so I need to apply some constraints programmatically in Swift to a UIView using this code:
var new_view:UIView! = ...
            
        
       
    
            769
            votes
        
        
            28
            answers
        
        
            816k
            views
        
    How to link to apps on the app store
                I am creating a free version of my iPhone game. I want to have a button inside the free version that takes people to the paid version in the app store. If I use a standard link
http://itunes.apple....
            
        
       
    
            2340
            votes
        
        
            51
            answers
        
        
            764k
            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 ...
            
        
       
    
            1049
            votes
        
        
            12
            answers
        
        
            338k
            views
        
    How do I animate constraint changes?
                I'm updating an old app with an AdBannerView and when there is no ad, it slides off screen. When there is an ad it slides on the screen. Basic stuff.
Old style, I set the frame in an animation block.
...
            
        
       
    
            546
            votes
        
        
            18
            answers
        
        
            307k
            views
        
    How to programmatically send SMS on the iPhone?
                Does anybody know if it's possible, and how, to programmatically send a SMS from the iPhone, with the official SDK / Cocoa Touch?
            
        
       
    
            232
            votes
        
        
            16
            answers
        
        
            192k
            views
        
    Swift extract regex matches
                I want to extract substrings from a string that match a regex pattern. 
So I'm looking for something like this:
func matchesForRegexInText(regex: String!, text: String!) -> [String] {
   ???
}
...