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
220,736
questions
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 ...
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 ...
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 ...
190
votes
17
answers
141k
views
Get UIScrollView to scroll to the top
How do I make a UIScrollView scroll to the top?
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 ...
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?
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?
188
votes
27
answers
127k
views
Dashed line border around UIView
How do I add dashed line border around UIView.
Something Like this
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'...
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 (...
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 ...
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
...
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 ...
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?
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.
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 ...
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: ...
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 ...
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 ...
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 ...
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?
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 ...
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?
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", ...
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 ...
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 ...
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:...
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 ...
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 ...
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,...
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 ...
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 ...
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
...
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 ...
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] ...
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 ...
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 ...
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 ...
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?
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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?
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 ...
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?
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 ...
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?