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,755
questions
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 ...
227
votes
19
answers
218k
views
Opening the Settings app from another app
Okay, I know that there are many question about it, but they are all from many time ago.
So. I know that it is possible because the Map app does it.
In the Map app if I turn off the localization for ...
227
votes
14
answers
100k
views
Detect Retina Display
Does iOS SDK provides an easy way to check if the currentDevice has an high-resolution display (retina) ?
The best way I've found to do it now is :
if ([[UIScreen mainScreen] respondsToSelector:@...
226
votes
3
answers
75k
views
What should Xcode 6 gitignore file include?
What should the typical .gitignore include for Xcode 6?
Also for information regarding the xccheckout introduced in Xcode 5 see here
225
votes
14
answers
189k
views
Figure out size of UILabel based on String in Swift
I am trying to calculate the height of a UILabel based on different String lengths.
func calculateContentHeight() -> CGFloat{
var maxLabelSize: CGSize = CGSizeMake(frame.size.width - 48, ...
225
votes
30
answers
142k
views
App store link for "rate/review this app"
I want to put a "rate/review this app" feature into my app.
Is there a way to link directly to the screen in the app store where they review the app? So the customer doesn't have to click through ...
225
votes
7
answers
150k
views
How to access SOAP services from iPhone
I'm planning to develop an app for the iPhone and that app would have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK I was not able to find any support for ...
222
votes
10
answers
356k
views
How to create .ipa file using Xcode?
Please tell me the complete procedure to build my app & use it on a real iPhone.
222
votes
25
answers
37k
views
Xcode 4 says "finished running <my app>" on the targeted device -- Nothing happens
The app neither installs nor runs on my device. All provisioning profiles are up to date. I've already tried deleting and re-installing them.
The status bar shows that Xcode is building my project, ...
221
votes
7
answers
177k
views
Gradients on UIView and UILabels On iPhone [duplicate]
Possible Duplicate:
Manually drawing a gradient in iPhone apps?
My application needs to display text in either a UIView or UILabel but the back ground must be a gradient as opposed to a true ...
220
votes
21
answers
82k
views
Converting Storyboard from iPhone to iPad
I have an iPhone application which has a storyboard. Now I want to provide an iPad application too. So I asked me whether there is a function which helps me convert my iPhone storyboard to an iPad ...
220
votes
11
answers
111k
views
NSUserDefaults - How to tell if a key exists
I'm working on a small iPhone app, and I am using NSUserDefaults as my data persistence. It only has to keep track of a few things, such as some names and some numbers so I figure I might as well ...
220
votes
7
answers
153k
views
How to check if a file exists in Documents folder?
I have an application with In-App Purchase, that when the user buy something, download one html file into the Documents folder of my app.
Now I must check if this HTML file exists, so if true, load ...
219
votes
9
answers
153k
views
receiver type *** for instance message is a forward declaration
In my iOS5 app, I have NSObject States class, and trying to init it:
states = [states init];
here is init method in States:
- (id) init
{
if ((self = [super init]))
{
pickedGlasses =...
219
votes
5
answers
66k
views
How do I enter RGB values into Interface Builder?
How can I enter RGB or Hex color values for backgrounds in Interface Builder? I can select predefined colors but I would like to manually enter in RGB values. Where can I do this?
217
votes
27
answers
176k
views
How do I hide the status bar in a Swift iOS app?
I'd like to remove the status bar at the top of the screen.
This does not work:
func application
(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: NSDictionary?)
-> Bool
{
...
217
votes
26
answers
137k
views
Detecting which UIButton was pressed in a UITableView
I have a UITableView with 5 UITableViewCells. Each cell contains a UIButton which is set up as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)...
217
votes
13
answers
48k
views
iPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet
Note:
See accepted answer (not top voted one) for solution as of iOS 4.3.
This question is about a behavior discovered in the iPad keyboard, where it refuses to be dismissed if shown in a modal ...
214
votes
31
answers
149k
views
Is it possible to disable floating headers in UITableView with UITableViewStylePlain?
I'm using a UITableView to layout content 'pages'. I'm using the headers of the table view to layout certain images etc. and I'd prefer it if they didn't float but stayed static as they do when the ...
214
votes
2
answers
108k
views
How to fix UITableView separator on iOS 7? [duplicate]
UITableView draws with ragged lines on iOS 7:
How to fix it? The line between cells should be on the full width of the screen.
214
votes
12
answers
318k
views
Setting an image for a UIButton in code
How do you set the image for a UIButton in code?
I have this:
UIButton *btnTwo = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btnTwo.frame = CGRectMake(40, 140, 240, 30);
[btnTwo setTitle:@"...
214
votes
12
answers
118k
views
Is there any way to see the file system on the iOS simulator?
Is there any way to browse the file system of a currently running or just killed iOS simulator? I'd settle for being able to see a specific app's files if there's a way to do that.
Note that I don't ...
213
votes
4
answers
112k
views
Swift - Convert to absolute value
is there any way to get absolute value from an integer?
for example
-8
to
8
I already tried to use UInt() assuming it will convert the Int to unsigned value but it didn't work.
211
votes
19
answers
125k
views
Determine on iPhone if user has enabled push notifications
I'm looking for a way to determine if the user has, via settings, enabled or disabled their push notifications for my application.
210
votes
16
answers
235k
views
Xcode 4 - "Valid signing identity not found" error on provisioning profiles on a new Macintosh install
I had a Macintosh I used to develop iPhone apps with using Xcode 4.
I now have a new Macintosh with a new install of... everything.
When opening Xcode projects built on the old Mac, I cannot run the ...
209
votes
5
answers
187k
views
How can I change UIButton title color?
I create a button programmatically..........
button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[...
207
votes
16
answers
161k
views
'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format'
I submitted an app update, but I have received an email telling me this error has occurred:
Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of ...
207
votes
55
answers
66k
views
Xcode 4 hangs at "Attaching to (app name)"
I just upgraded to Xcode 4 and for some reason my app won't run in the simulator or iOS device. It was working perfectly in Xcode 3, but all of a sudden now when I press run the program stops at "...
206
votes
12
answers
268k
views
How to segue programmatically in iOS using Swift
I'm creating an app that uses the Facebook SDK to authenticate users. I'm trying to consolidate the facebook logic in a separate class. Here is the code (stripped for simplicity):
import Foundation
...
205
votes
14
answers
452k
views
How can I install a .ipa file to my iPhone simulator
I have an iphone simulator running on my Mac.
I have a .ipa file, can you please tell me how can I install it on the simulator?
203
votes
16
answers
95k
views
How can I click a button behind a transparent UIView?
Let's say we have a view controller with one sub view. the subview takes up the center of the screen with 100 px margins on all sides. We then add a bunch of little stuff to click on inside that ...
202
votes
3
answers
163k
views
@try - catch block in Objective-C
Why doesn't @try block work?
It crashed the app, but it was supposed to be caught by the @try block.
NSString* test = [NSString stringWithString:@"ss"];
@try {
[test characterAtIndex:6];
}
@...
201
votes
27
answers
109k
views
Zooming MKMapView to fit annotation pins?
I am using MKMapView and have added a number of annotation pins to the map about a 5-10 kilometre area. When I run the application my map starts zoomed out to show the whole world, what is the best ...
201
votes
24
answers
225k
views
How do I URL encode a string
I have a URL string (NSString) with spaces and & characters. How do I url encode the entire string (including the & ampersand character and spaces)?
201
votes
9
answers
116k
views
how to programmatically fake a touch event to a UIButton?
I'm writing some unit tests and, because of the nature of this particular app, it's important that I get as high up the UI chain as possible. So, what I'd like to do is programmatically trigger a ...
201
votes
9
answers
111k
views
iPhone App Minus App Store?
If I create an application on my Mac, is there any way I can get it to run on an iPhone without going through the app store?
It doesn't matter if the iPhone has to be jailbroken, as long as I can ...
200
votes
9
answers
101k
views
How do I export UIImage array as a movie?
I have a serious problem: I have an NSArray with several UIImage objects. What I now want to do, is create movie from those UIImages. But I don't have any idea how to do so.
I hope someone can help ...
199
votes
15
answers
167k
views
How to save picture to iPhone photo library?
What do I need to do to save an image my program has generated (possibly from the camera, possibly not) to the system photo library on the iPhone?
198
votes
24
answers
170k
views
Finding the direction of scrolling in a UIScrollView?
I have a UIScrollView with only horizontal scrolling allowed, and I would like to know which direction (left, right) the user scrolls. What I did was to subclass the UIScrollView and override the ...
198
votes
11
answers
109k
views
Long press on UITableView
I would like to handle a long press on a UITableViewCell to print a "quick access menu".
Did someone already do this?
Particularly the gesture recognize on UITableView?
198
votes
5
answers
56k
views
How does TestFlight do it?
TestFlight offers over-the-air beta distribution of iOS apps (on non-jailbroken devices). How can this be done? Is this an iOS feature, or a vulnerability exploit?
196
votes
13
answers
80k
views
UIButton inside a view that has a UITapGestureRecognizer
I have view with a UITapGestureRecognizer. So when I tap on the view another view appears above this view. This new view has three buttons. When I now press on one of these buttons I don't get the ...
196
votes
19
answers
151k
views
Warning :-Presenting view controllers on detached view controllers is discouraged
In my app, I am using a navigation controller. Later on in some view I am using presentViewController for showing a zoomed image.
Also I am not using a Storyboard or nib.
I am getting this error in ...
195
votes
11
answers
188k
views
Xcode/Simulator: How to run older iOS version?
I'm thinking of upgrading to iOS SDK 4.2. But what I'm wondering is if I'll still be able to run the simulator as iOS 3.2. This is because I'm creating iAds for iPad but I still want to check if my ...
194
votes
13
answers
111k
views
Handling applicationDidBecomeActive - "How can a view controller respond to the app becoming Active?"
I have the UIApplicationDelegate protocol in my main AppDelegate.m class, with the applicationDidBecomeActive method defined.
I want to call a method when the application returns from the background,...
194
votes
27
answers
91k
views
Xcode 6 beta 2 issue exporting .ipa: "Your account already has a valid iOS distribution certificate"
I'm having trouble exporting an app for Ad Hoc Distribution on Xcode 6 beta 2:
When exporting my project for ad hoc development on Xcode 6, I receive this alert. I've tried exporting it on Xcode 5 ...
193
votes
17
answers
115k
views
How can I change the color of pagination dots of UIPageControl?
I am developing an application in which I want to change either color or image of UIPageControl pagination dots. How can I change it? Is it possible to customize UIpageControl on above scenario?
193
votes
11
answers
304k
views
How do I put a clear button inside my HTML text input box like the iPhone does?
I want to have a nice little icon that, when clicked will clear the text in the <INPUT> box.
This is to save space rather than having a clear link outside of the input box.
My CSS skills are ...
192
votes
22
answers
200k
views
How do you dismiss the keyboard when editing a UITextField
I know that I need to tell my UITextField to resign first responder when I want to dismis the keyboard, but I'm not sure how to know when the user has pressed the "Done" key on the keyboard. Is there ...
192
votes
21
answers
221k
views
How to add a right button to a UINavigationController?
I am trying to add a refresh button to the top bar of a navigation controller with no success.
Here is the header:
@interface PropertyViewController : UINavigationController {
}
Here is how I am ...