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
52
votes
11 answers

How to display a base64 image within a UIImageView?

I got this Base64 gif image: R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7 Now I want to display this Base64 String within my IPhone App. I could…
jantimon
  • 36,840
  • 23
  • 122
  • 185
52
votes
11 answers

NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

so I'm making an app with 5 view controllers, the first is embedded in a UINavigationController and the segue between the first 4 view controllers works fine. However introducing a 5th View Controller has broken this, and I'm getting the…
DouglasBoone
  • 523
  • 1
  • 4
  • 4
52
votes
6 answers

Remove Auto-Layout Constraints for Specific Object

I have a UIImageView embedded in a UIView. My entire app uses AutoLayout, but I want to remove constraints for the UIImageView. Xcode will not allow me to delete the constraints, is there a way to disable them for a specific object, set them to…
Eric
  • 4,063
  • 2
  • 27
  • 49
52
votes
2 answers

What is the iOS 6 user agent string?

What is the iOS 6.0 user agent string? Previous user-agent strings: iOS 5.1 - What is the iOS 5.1 user agent string? iOS 5.0 - What is the iOS 5.0 user agent string? iOS 4.0 - What is the iPhone 4 user-agent?
chown
  • 51,908
  • 16
  • 134
  • 170
52
votes
2 answers

What is PurpleEventCallback?

In the stack trace of my iPhone application, I see a call to something called PurpleEventCallback. I wasn't able to find any documentation for it. What is this?
Manav
  • 10,094
  • 6
  • 44
  • 51
52
votes
11 answers

How to remove gesture recogniser

SO, I am adding a gesture recogniser to an overlay view. When tapped on screen i want this overlay to go away. Having said that adding a gesture recognizer overrides the "touch up inside" and other button click events. I need this back therefore i…
CodeGeek123
  • 4,341
  • 8
  • 50
  • 79
51
votes
22 answers

How to enable cancel button with UISearchBar?

In the contacts app on the iPhone if you enter a search term, then tap the "Search" button, the keyboard is hidden, BUT the cancel button is still enabled. In my app the cancel button gets disabled when I call resignFirstResponder. Anyone know how…
Christopher
  • 5,806
  • 7
  • 31
  • 41
51
votes
7 answers

How to add a view behind other view in iOS

I want to add a view under my tab bar analog in iOS and then show it with animation coming from behind it. But when I use my code, the view that must come from behind my tab bar overlaps my tab bar for a while. This is my code: -…
Denis Kutlubaev
  • 15,320
  • 6
  • 84
  • 70
51
votes
5 answers

How to I pass @selector as a parameter?

For the method: [NSThread detachNewThreadSelector:@selector(method:) toTarget:self withObject:(id)SELECTOR]; How do I pass in a @selector? I tried casting it to (id) to make it compile, but it crashes in runtime. More specifically, I have a method…
erotsppa
  • 14,248
  • 33
  • 123
  • 181
51
votes
10 answers

Unable to process application info.plist validation at this time due to a general error (1095)

I am creating a newsstand application. the application is ready, now i am trying to upload the app in apple store using Application Loader. While uploading the zip file its showing the error message as Unable to process application info.plist…
Naveen
  • 900
  • 1
  • 7
  • 23
51
votes
4 answers

iPhone Core Animation - Drawing a Circle

I wish to create an animation. The best way I can explain this is if you can imagine drawing a circle. It starts at the top or 12 o clock and draws clockwise all the way around until it becomes a complete circle over the space of 10 or so…
bennythemink
  • 5,096
  • 4
  • 36
  • 54
51
votes
7 answers

What does 8badf00d mean?

Sometimes my iPhone application crashes with a weird crashlog, that reads exception code is 0x8badf00d. The stacktraces show random snapshots of app execution, but nothing suspicious. This happens very rarely and I'm not able to find out how to…
Vladimir Grigorov
  • 10,903
  • 8
  • 60
  • 70
51
votes
6 answers

How to convert NSData to byte array in iPhone?

I want to convert NSData to a byte array, so I write the following code: NSData *data = [NSData dataWithContentsOfFile:filePath]; int len = [data length]; Byte byteData[len]; byteData = [data bytes]; But the last line of code pops up an error…
Chilly Zhong
  • 16,763
  • 23
  • 77
  • 103
51
votes
9 answers

Should I use NSUserDefaults or a plist to store data?

I will be storing a few strings (maybe 10-20). I am not sure if I should use NSUserDefaults to save them, or write them out to a plist. What is considered best practice? NSUserDefaults seems like it is less lines of code, therefore quicker to…
Sheehan Alam
  • 60,111
  • 124
  • 355
  • 556
51
votes
9 answers

How to check iOS app size before upload

I would like to be able to check the size of my app before submitting to the app store. More specifically I need to know whether it will be below the magic 20 MB, to allow cellular downloads, since the app is created for a festival.
ViggoV
  • 2,133
  • 2
  • 20
  • 22