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
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 ...
FelipeDev.-'s user avatar
  • 3,133
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:@...
Pierre Valade's user avatar
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
Epic Byte's user avatar
  • 33.9k
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, ...
Cody Weaver's user avatar
  • 4,826
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 ...
William Jockusch's user avatar
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 ...
Gero's user avatar
  • 2,967
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.
Surjit Joshi's user avatar
  • 3,357
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, ...
D-Nice's user avatar
  • 4,802
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 ...
TonyNeallon's user avatar
  • 6,607
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 ...
dehlen's user avatar
  • 7,335
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 ...
Ethan Mick's user avatar
  • 9,537
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 ...
Obliviux's user avatar
  • 2,669
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 =...
SentineL's user avatar
  • 4,722
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?
Sheehan Alam's user avatar
  • 60.5k
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 { ...
Jay's user avatar
  • 9,514
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 *)...
rein's user avatar
  • 33.3k
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 ...
Kalle's user avatar
  • 13.2k
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 ...
Tricky's user avatar
  • 7,095
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.
Dmitry's user avatar
  • 14.5k
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:@"...
Spanky's user avatar
  • 4,990
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 ...
Chris Williams's user avatar
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.
Niko Adrianus Yuwono's user avatar
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.
Kevin's user avatar
  • 3,700
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 ...
Oliver's user avatar
  • 23.3k
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]; [...
HelloWorld's user avatar
  • 7,236
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 ...
TelKitty's user avatar
  • 3,146
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 ...
Shlomi Schwartz's user avatar
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?
yinglcs's user avatar
  • 2,981
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 ...
Sean Clark Hess's user avatar
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]; } @...
Alexandru Circus's user avatar
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 ...
fuzzygoat's user avatar
  • 26.1k
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)?
xonegirlz's user avatar
  • 8,939
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 ...
Olie's user avatar
  • 24.7k
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 ...
Dan Walker's user avatar
  • 7,143
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 ...
Nuker's user avatar
  • 2,597
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?
jblocksom's user avatar
  • 14.3k
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 ...
Alex1987's user avatar
  • 9,457
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?
foOg's user avatar
  • 3,146
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?
hpique's user avatar
  • 120k
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 ...
V1ru8's user avatar
  • 6,157
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 ...
Gagan Joshi's user avatar
  • 3,377
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 ...
Shai UI's user avatar
  • 51.2k
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,...
Calvin's user avatar
  • 8,735
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 ...
3254523's user avatar
  • 3,026
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?
Tirth's user avatar
  • 7,789
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 ...
Hugh Buchanan's user avatar
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 ...
kubi's user avatar
  • 48.8k
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 ...
Artilheiro's user avatar
  • 4,005