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].

iphone
Filter by
Sorted by
Tagged with
192 votes
2 answers
228k views

SSL certificate is not trusted - on mobile only [closed]

My site is working great over SSL in my desktops (chrome) I have a green lock near the address bar saying "Identity verified" But using a mobile mobile browser (Chrome/Safari)I see the following ...
Avi Zloof's user avatar
  • 2,963
191 votes
18 answers
197k views

How to customize the background color of a UITableViewCell?

I would like to customize the background (and maybe the border too) of all of the UITableViewCells within my UITableView. So far I have not been able to customize this stuff, so I have a bunch of ...
jpm's user avatar
  • 16.7k
191 votes
8 answers
129k views

iOS: Multi-line UILabel in Auto Layout

I'm having trouble trying to achieve some very basic layout behavior with Auto Layout. My view controller looks like this in IB: The top label is the title label, I don't know how many lines it will ...
James Harpe's user avatar
  • 4,345
190 votes
17 answers
141k views

Get UIScrollView to scroll to the top

How do I make a UIScrollView scroll to the top?
Jack Humphries's user avatar
190 votes
17 answers
124k views

UIImage: Resize, then Crop

I've been bashing my face into this one for literally days now and even though I feel constantly that I am right on the edge of revelation, I simply cannot achieve my goal. I thought, ahead of time ...
Carson C.'s user avatar
  • 2,372
190 votes
12 answers
147k views

How can I scan barcodes on iOS? [closed]

How can I simply scan barcodes on iPhone and/or iPad?
Stefan's user avatar
  • 28.9k
189 votes
11 answers
169k views

Creating .pem file for APNS?

How do I create a .pem file to be stored in the hosting server for APN payload data?
Biranchi's user avatar
  • 16.2k
188 votes
27 answers
127k views

Dashed line border around UIView

How do I add dashed line border around UIView. Something Like this
Sohaib's user avatar
  • 11.1k
187 votes
26 answers
103k views

The model used to open the store is incompatible with the one used to create the store

I created a Core Data model in xcode 3.2 and after upgrading in Xcode 4.2, I then added a new entity of the NSManagedObject subclass (refer to the new entity). First thing, it looks weird because it'...
dejoong's user avatar
  • 2,233
187 votes
32 answers
139k views

Certificate has either expired or has been revoked

A while ago I started coding a new iOS app. After a long break from it, I'm working on it again and have it almost complete. I tested it on the simulator but when I tried to install it on my iPhone 6 (...
user6218736's user avatar
  • 1,871
185 votes
12 answers
291k views

How can I check if an app is installed from a web-page on an iPhone

I want to create a web-page, a page that will redirect an iPhone to the App Store if the iPhone does not have the application installed, but if the iPhone has the app installed I want it to open the ...
Joakim Engstrom's user avatar
185 votes
5 answers
138k views

UIButton title text color

I'm setting text color for UIButton headingButton.titleLabel.textColor = [UIColor colorWithRed:36/255.0 green:71/255.0 ...
Ali's user avatar
  • 1,951
185 votes
6 answers
180k views

How do I define and use an ENUM in Objective-C?

I declared an enum in my implementation file as shown below, and declared a variable of that type in my interface as PlayerState thePlayerState; and used the variable in my methods. But I am getting ...
RexOnRoids's user avatar
185 votes
11 answers
145k views

Programmatically add custom event in the iPhone Calendar

Is there any way to add iCal event to the iPhone Calendar from the custom App?
Vadim's user avatar
  • 9,463
185 votes
7 answers
113k views

Removing App ID from Developer Connection

How do I remove an App ID from the developer program portal area? I mistakenly added a couple of app id's under the wrong login and would like to remove them, but I am not seeing a way to do so.
user avatar
183 votes
8 answers
117k views

ViewDidAppear is not called when opening app from background

I have a View Controller in which my value is 0 (label) and when I open that View Controller from another ViewController I have set viewDidAppear to set value 20 on label. It works fine but when I ...
Zohaib's user avatar
  • 2,855
183 votes
12 answers
176k views

Programmatically change UITextField Keyboard type

Is it possible to programmatically change the keyboard type of a uitextfield so that something like this would be possible: if(user is prompted for numeric input only) [textField setKeyboardType: ...
eric.mitchell's user avatar
183 votes
14 answers
241k views

Launch an app from within another (iPhone)

Is it possible to launch any arbitrary iPhone application from within another app?, For example in my application if I want the user to push a button and launch right into the Phone app (close the ...
user avatar
182 votes
40 answers
75k views

Cannot generate iOS App archive in xcode

I have a problem generating a iOS App archive from an application. The application compiles just fine and even works in the simulator. Now I wanted to make som ad hoc testing and cannot generate the ...
Filip Majernik's user avatar
182 votes
12 answers
257k views

How do I correctly detect orientation change using Phonegap on iOS?

I found this orientation test code below looking for JQTouch reference material. This works correctly in the iOS simulator on mobile Safari but doesn’t get handled correctly in Phonegap. My project is ...
ajpalma's user avatar
  • 1,823
182 votes
16 answers
95k views

How do I detect that an iOS app is running on a jailbroken phone?

If I want my app to behave differently on a jailbroken iPhone, how would I go about determining this?
Ben Gottlieb's user avatar
  • 85.5k
181 votes
29 answers
170k views

Setting action for back button in navigation controller

I'm trying to overwrite the default action of the back button in a navigation controller. I've provided a target an action on the custom button. The odd thing is when assigning it though the ...
Parrots's user avatar
  • 26.7k
180 votes
9 answers
216k views

How can I get current location from user in iOS

How can I get the current location from user in iOS?
mamrezo's user avatar
  • 2,283
180 votes
11 answers
228k views

adding multiple entries to a HashMap at once in one statement

I need to initialize a constant HashMap and would like to do it in one line statement. Avoiding sth like this: hashMap.put("One", new Integer(1)); // adding value into HashMap hashMap.put("Two", ...
user387184's user avatar
180 votes
6 answers
80k views

Pull to refresh UITableView without UITableViewController

I'm trying to implement a pull to refresh feature in a UITableView within a UIViewController. I can't use a UITableViewController because I want the UITableView to be a smaller subview in the view ...
Daniel Robinson's user avatar
178 votes
11 answers
128k views

ios app maximum memory budget

I'm working on an ios game that's targeting as a minimum the 3gs. We are using HD assets for retina display devices (iphone 4, ipod touch 4th gen). Memory wise, Ipod Touch 4th gen seems to be the ...
frilla's user avatar
  • 1,813
178 votes
18 answers
105k views

Can I change multiplier property for NSLayoutConstraint?

I created two views in one superview, and then added constraints between views: _indicatorConstrainWidth = [NSLayoutConstraint constraintWithItem:self.view1 attribute:NSLayoutAttributeWidth relatedBy:...
Bimawa's user avatar
  • 3,565
178 votes
14 answers
104k views

Reset push notification settings for app

I am developing an app with push notifications. To check all possible ways of user interaction, I'd like to test my app when a user declines to have push notifications enabled for my app during the ...
hanno's user avatar
  • 6,461
177 votes
20 answers
58k views

UITableViewCell subview disappears when cell is selected

I'm implementing a color-chooser table view where the user can select amongst, say, 10 colors (depends on the product). The user can also select other options (like hard drive capacity, ...). All ...
Cyrille's user avatar
  • 25.1k
177 votes
5 answers
108k views

What's the difference between using CGFloat and float?

I tend to use CGFloat all over the place, but I wonder if I get a senseless "performance hit" with this. CGFloat seems to be something "heavier" than float, right? At which points should I use CGFloat,...
user avatar
175 votes
32 answers
505k views

HTML5 Video tag not working in Safari , iPhone and iPad

I am trying to create an html5 web page in which there is a small video like 13s , I converted the flash version of this video into 3 format : .ogv using fireFogg , .webm using firefogg also and .mp4 ...
Khaled Al Hage Ismail's user avatar
174 votes
12 answers
123k views

Switching to a TabBar tab view programmatically?

Let's say I have a UIButton in one tab view in my iPhone app, and I want to have it open a different tab in the tab bar of the TabBarController. How would I write the code to do this? I'm assuming ...
rottendevice's user avatar
  • 2,869
174 votes
24 answers
76k views

Could not launch process launch failed: timed out waiting for app to launch

I am trying to launch my app on device. It is launching successfully on the simulator. List item I use 7.1 SDK Xcode 5 And the device is a 7.1 iPhone 4S I have tried: Clean Clean Build Folder ...
user317706's user avatar
  • 2,077
174 votes
30 answers
154k views

Check if my app has a new version on AppStore

I would like to manually check if there are new updates for my app while the user is in it, and prompt him to download the new version. Can I do this by checking the version of my app in the app store ...
user542584's user avatar
  • 2,691
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] ...
Hot Licks's user avatar
  • 47.3k
172 votes
22 answers
155k views

How to detect when a UIScrollView has finished scrolling

UIScrollViewDelegate has got two delegate methods scrollViewDidScroll: and scrollViewDidEndScrollingAnimation: but neither of these tell you when scrolling has completed. scrollViewDidScroll only ...
Michael Gaylord's user avatar
171 votes
11 answers
181k views

How can I delay a method call for 1 second?

Is there an easy way delay a method call for 1 second? I have a UIImageView that reacts on a touch event. When the touch is detected, some animations happen in the app. After one second, I want to ...
Thanks's user avatar
  • 40.3k
171 votes
9 answers
110k views

UITapGestureRecognizer - single tap and double tap

I am trying to add 2 UITapGestureRecognizers to a view, one for single tap and one for double tap events. The single tap recognizer is working as expected (on its own). But I don't seem to be able ...
Stanley's user avatar
  • 4,476
171 votes
18 answers
160k views

Set the location in iPhone Simulator

How can I set the location (as it's picked up in CoreLocation services) in the iPhone Simulator?
Cliff's user avatar
  • 10.9k
170 votes
7 answers
78k views

iphone Core Data Unresolved error while saving

I am getting a strange error message from the core data when trying to save but the problem that the error is not reproducible ( it appears at different times when doing different tasks) the error ...
Ahmed Kotb's user avatar
  • 6,287
170 votes
18 answers
201k views

How to load local html file into UIWebView

I'm trying to load a html file into my UIWebView but it won't work. Here's the stage: I have a folder called html_files in my project. Then I created a webView in interface builder and assigned an ...
madcoderz's user avatar
  • 4,433
170 votes
5 answers
232k views

Adding iOS UITableView HeaderView (not section header)

I want to add a table header (not section headers) like in the contacts app for example: exactly like that - a label beside an image above of the table. I want the all view be scrollable so I can't ...
AMM's user avatar
  • 2,195
169 votes
8 answers
62k views

What is the default height of UITableViewCell?

I thought this information would have been easier to find :-) What is the default height of a UITableViewCell? It looks like 44 pixels, but I'd prefer to be sure.
Rob's user avatar
  • 26.2k
169 votes
7 answers
105k views

What's the difference between "bundle display name" and "bundle name" in cocoa application's info plist

Here is a good question: Bundle Name, Executable Name, Product Name...anything else? but I just wonder about the difference between "bundle display name" and "bundle name" in cocoa application's ...
xhan's user avatar
  • 6,197
168 votes
17 answers
100k views

How to detect first time app launch on an iPhone

How can I detect the very first time launch of - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // if very first launch than perform ...
Shishir.bobby's user avatar
168 votes
12 answers
147k views

Given a view, how do I get its viewController?

I have a pointer to a UIView. How do I access its UIViewController? [self superview] is another UIView, but not the UIViewController, right?
mahboudz's user avatar
  • 39.3k
168 votes
3 answers
59k views

A complete solution to LOCALLY validate an in-app receipts and bundle receipts on iOS 7

I have read a lot of docs and code that in theory will validate an in-app and/or bundle receipt. Given that my knowledge of SSL, certificates, encryption, etc., is nearly zero, all of the ...
Duck's user avatar
  • 35.5k
168 votes
6 answers
100k views

What is the difference between a .xib file and a .storyboard?

Can someone explain in simple words the difference between .xib and .storyboard?
gsach's user avatar
  • 5,735
168 votes
18 answers
135k views

iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari?

I'm writing a web app for the iPad (not a regular App Store app - it's written using HTML, CSS and JavaScript). Since the keyboard fills up a huge part of the screen, it would make sense to change the ...
LKM's user avatar
  • 4,351
167 votes
9 answers
70k views

Obscure a UITextField password

I am doing a login page. I have UITextField for password. Obviously, I do not want the password to be seen; instead, I want circles to show when typing. How do you set the field for this to happen?
harsh_017's user avatar
  • 1,751