Questions tagged [iphone]

DO NOT use this tag unless you are addressing Apple's iPhone and/or iPod touch specifically. For questions not dependent on hardware, use the tag [ios]. More tags to consider are [xcode] (but only if the question is about the IDE itself), [swift], [objective-c] or [cocoa-touch] (but not [cocoa]). Please refrain from questions regarding the iTunes App Store or about iTunes Connect. If using C#, tag with [mono].

The iPhone is a smartphone made by Apple Inc. It was first launched on June 29, 2007, and has since been through several major hardware and software revisions. The iPhone, iPad, and iPod touch each run iOS (previously iPhone OS). Native iOS applications are written in Objective-C or in Swift since the release of iOS8, using the Cocoa Touch frameworks. These frameworks are distinct from Cocoa which is used exclusively for macOS development, though the two frameworks share many classes and features.

Most questions related to iPhone are also applicable to iPod touch devices since they support similar resolutions, input methods and features.

In all cases, questions that are specific to the features of a particular device should use the appropriate tag. Please refrain from questions regarding the App Store.

The iPhone has several hardware features and sensors which are accessible to native applications (and in some cases, to web apps via special APIs), including:

  • 3-axis accelerometer
  • 3-axis gyroscope
  • Magnetometer
  • GPS and A-GPS
  • Proximity sensor
  • Microphone, speaker, and headphone port
  • Front (since iPhone 4) and rear cameras, and LED flash
  • Lightning Dock Connector (iPhone 5 and above and iPod Touch 5th generation and above) and 30-pin dock connector (all others)
  • Fingerprint recognition system (Touch ID introduced with iPhone 5s)
  • Barometer (Introduced along with iPhone 6)
  • Multi-Touch touchscreen display (3D Touch introduced with iPhone 6s)
  • Dual Camera (iPhone 7 Plus, iPhone 8 Plus, iPhone X)
  • Face recognition system (Face ID introduced with iPhone X)

While native iPhone and iPod touch applications use the Cocoa Touch frameworks and are developed using the Xcode IDE, and questions about classes that exist in both Cocoa and Cocoa Touch can accurately wear both tags, most questions should use only one or the other.


Models

  • iPhone (1st generation)
  • iPhone 3G
  • iPhone 3GS
  • iPhone 4
  • iPhone 4S
  • iPhone 5
  • iPhone 5C
  • iPhone 5S
  • iPhone SE
  • iPhone 6
  • iPhone 6 Plus
  • iPhone 6S
  • iPhone 6S Plus
  • iPhone 7
  • iPhone 7 Plus
  • iPhone 8
  • iPhone 8 Plus
  • iPhone X
  • iPhone XS
  • iPhone XS Max
  • iPhone XR
  • iPhone 11
  • iPhone 11 Pro
  • iPhone 11 Pro Max
  • iPhone 12
  • iPhone 12 mini
  • iPhone 12 Pro
  • iPhone 12 Pro Max
  • iPhone 13
  • iPhone 13 mini
  • iPhone 13 Pro
  • iPhone 13 Pro Max

Resources

Apple Official Documentations

Books

  • Apress - Beginning iOS 6 development
  • Apress - Learn Objective-C on the Mac
  • Oreilly - iPhone App Development The Missing Manual
  • Objective-C Programming: The Big Nerd Ranch Guide
  • iOS 7 by Tutorials
  • Beginning iPhone SDK Programming with Objective-C

Blogs with Good Tutorials Collection

FAQ


Related Tags

221329 questions
244
votes
35 answers

Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

I have imported framework for sending email from application in background i.e. SKPSMTPMessage Framework. Can somebody suggest why below error is shown Undefined symbols for architecture i386: "_OBJC_CLASS_$_SKPSMTPMessage", referenced from: …
Mann
  • 5,477
  • 6
  • 45
  • 57
243
votes
11 answers

How can I send mail from an iPhone application

I want to send an email from my iPhone application. I have heard that the iOS SDK doesn't have an email API. I don't want to use the following code because it will exit my application: NSString *url = [NSString stringWithString:…
Khushi
  • 3,119
  • 6
  • 25
  • 14
241
votes
69 answers

Apple Mach-O Linker Error when compiling for device

I've just upgraded to xcode 4.0 and I can no longer deploy to iPhone, I get a Apple Mach-O Linker Error, it still works for the simulator though. Ld…
CodeVomit
  • 749
  • 2
  • 7
  • 10
241
votes
43 answers

A valid provisioning profile for this executable was not found for debug mode

I am getting this error while I am trying to debug my app on device. I created development provisioning profile as it is mentioned at the developer portal. My development device is selected in the profile and I am selecting the correct profile from…
xenep
  • 3,375
  • 4
  • 20
  • 19
240
votes
38 answers

Launch Screen storyboard not displaying image

I'm trying to get an image to display as the launch screen from my Launch Screen.storyboard file, however the image never displays. I have labels that show up fine, but the image doesn't appear. This is how the launch screen looks in the Launch…
shadowarcher
  • 3,265
  • 5
  • 21
  • 33
240
votes
11 answers

Xcode 'Build and Archive' menu item disabled

I have been using the new 'Build and Archive' feature of the latest Xcode 3.2.3. I like it. Now I noticed that it is always disabled for some reason. I can't seem to figure out what I changed to cause this.
toofah
  • 4,455
  • 4
  • 31
  • 42
238
votes
7 answers

applicationWillEnterForeground vs. applicationDidBecomeActive, applicationWillResignActive vs. applicationDidEnterBackground

Which is the proper delegate to implement when an application is waking up from being in the background and you want it to prep it to be active? applicationWillEnterForeground vs applicationDidBecomeActive -- What's the difference? Which is the…
Paul
  • 5,043
  • 7
  • 24
  • 24
238
votes
8 answers

iPhone - Get Position of UIView within entire UIWindow

The position of a UIView can obviously be determined by view.center or view.frame etc. but this only returns the position of the UIView in relation to it's immediate superview. I need to determine the position of the UIView in the entire 320x480…
adam
  • 22,404
  • 20
  • 87
  • 119
237
votes
6 answers

Styling input buttons for iPad and iPhone

I'm using CSS to style the input buttons on my website, but on IOS devices the styling is replaced by Mac's default buttons. Is there a way to style buttons for iOS, or a way to maybe make a hyperlink that behaves like a submit button?
mheavers
  • 29,530
  • 58
  • 194
  • 315
236
votes
9 answers

How can I use NSError in my iPhone App?

I am working on catching errors in my app, and I am looking into using NSError. I am slightly confused about how to use it, and how to populate it. Could someone provide an example on how I populate then use NSError?
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
235
votes
11 answers

iOS 7 Navigation Bar text and arrow color

I want to set background for Navigation Bar to be black and all colors inside it to be white. So, I used this code : [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], …
1110
  • 7,829
  • 55
  • 176
  • 334
235
votes
20 answers

Get push notification while App in foreground iOS

I am using push notification service in my app. When app is in background I am able to see notification on notification screen(screen shown when we swipe down from top of iOS device). But if application is in foreground the delegate method -…
Ab'initio
  • 5,368
  • 4
  • 28
  • 40
234
votes
16 answers

Get User's Current Location / Coordinates

How can I store the user's current location and also show the location on a map? I am able to show pre-defined coordinates on a map, I just don't know how to receive information from the device. Also I know I have to add some items into a Plist. How…
Awais Hussain
  • 2,400
  • 2
  • 12
  • 11
234
votes
17 answers

Change font size of UISegmentedControl

Can anyone please tell me how can I change the font type and size of UISegmentedControl?
Aashutosh Tiwari
  • 2,361
  • 2
  • 15
  • 5
234
votes
13 answers

Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?

I'd like to have iOS to open URLs from my domain (e.g. http://martijnthe.nl) with my app whenever the app is installed on the phone, and with Mobile Safari in case it is not. I read it is possible to create a unique protocol suffix for this and…
Martijn Thé
  • 4,674
  • 3
  • 29
  • 42