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,720
questions
166
votes
16
answers
96k
views
How to set the full width of separator in UITableView
I have a UITableView where the separators don't have the full width. It ends like 10 pixels before the left side. I was playing around with this code in the viewDidLoad().
self.tableView....
166
votes
13
answers
121k
views
Using HTML and Local Images Within UIWebView
I have a UIWebView in my app which I want to use to display an image which will link to another url.
I'm using
<img src="image.jpg" /> to load the image.
The problem is that the image doesn't ...
165
votes
17
answers
132k
views
iphone: Where the .dSYM file is located in crash report
According to this page here if you have proper application binary and .dSYM file then it is easy to symbolic them. But where are .dSYM and application binary files located?
165
votes
15
answers
61k
views
CABasicAnimation resets to initial value after animation completes
I am rotating a CALayer and trying to stop it at its final position after animation is completed.
But after animation completes it resets to its initial position.
(xcode docs explicitly say that the ...
165
votes
18
answers
130k
views
Convert HTML to NSAttributedString in iOS
I am using a instance of UIWebView to process some text and color it correctly, it gives the result as HTML but rather than displaying it in the UIWebView I want to display it using Core Text with a ...
165
votes
14
answers
90k
views
How to hide the "back" button in UINavigationController?
Do you know how to hide the 'back' button in a UINavigationController?
Also, how to show it back, but I guess that's very similar to hiding it...
Just like the mail application does on the iPhone ...
165
votes
4
answers
75k
views
Static table view outside UITableViewController
After the new Xcode update, my app doesn't validate and shows this error:
static table views are only valid when embedded in UITableViewController instances
Any chances to solve easily?
165
votes
4
answers
39k
views
What's the best way to communicate between view controllers?
Being new to objective-c, cocoa, and iPhone dev in general, I have a strong desire to get the most out of the language and the frameworks.
One of the resources I'm using is Stanford's CS193P class ...
165
votes
19
answers
60k
views
iOS app error - Can't add self as subview
I received this crash report, but I don't know how to debug it.
Fatal Exception NSInvalidArgumentException
Can't add self as subview
0 ... CoreFoundation __exceptionPreprocess + 130
1 libobjc....
164
votes
19
answers
132k
views
Disabled UIButton not faded or grey
In my iPhone app, I have a UIButton which I have created in Interface Builder. I can successfully enable and disable it like this in my code ...
sendButton.enabled = YES;
or
sendButton.enabled = NO;...
163
votes
11
answers
222k
views
Navigation bar show/hide
I have an app with a navigation bar consisting of 2 bar buttons. I would like to hide and show this navigation bar when a user double taps the screen.
Initially, the navigation bar should be hidden. ...
163
votes
6
answers
123k
views
How do I determine the target architecture of static library (.a) on Mac OS X?
I'm interested in verifying if a given iPhone static library has been built for ARM or Intel.
It's more curiosity than anything. Is there some kind of Mac OS X or BSD specific tool to do this? This ...
163
votes
8
answers
74k
views
How do I get the current version of my iOS project in code?
I would like to be able to get the current version of my iOS project/app as an NSString object without having to define a constant in a file somewhere. I don't want to change my version value in 2 ...
163
votes
27
answers
614k
views
Install .ipa to iPad with or without iTunes
I have the .ipa from PhoneGap build and I need to test it. I got provisioning profile from Developer account.
So my question is: can I directly put my .ipa to iPad to install for testing, or do I ...
163
votes
13
answers
278k
views
How do I lock the orientation to portrait mode in a iPhone Web Application?
I'm building a iPhone Web Application and want to lock the orientation to portrait mode. is this possible? Are there any web-kit extensions to do this?
Please note this is an application written in ...
162
votes
6
answers
135k
views
How can I convert NSDictionary to NSData and vice versa?
I am sending NSString and UIImage using bluetooth. I decided to store both in a NSDictionary and then convert the dictionary to NSData.
My question is how to convert NSDictionary to NSData and visa ...
162
votes
6
answers
107k
views
Remove textarea inner shadow on Mobile Safari (iPhone)
By default, it seems Mobile Safari adds the top inner shadow to all input fields, including textarea. Is there a way to remove it?
It's especially ugly when you have a white background.
161
votes
5
answers
72k
views
How to see if an NSString starts with a certain other string?
I am trying to check to see if a string that I am going to use as URL starts with http. The way I am trying to check right now doesn't seem to be working. Here is my code:
NSMutableString *temp = [[...
161
votes
1
answer
23k
views
Xcode 4.2 - declaration of '...' will not be visible outside of this function warning
I use Apple Reachability class from Apple Sample code
Reachability
in Xcode 4.2 and new Apple 3.0 compiler I get warning in this class that
+ (Reachability*) reachabilityWithAddress: (const struct ...
160
votes
15
answers
132k
views
UIButton: set image for selected-highlighted state
I set an images for button's states Normal,Highlighted and Selected, but when the button in selected state and I press/highlight it I didn't see my highlighted image but just grayed picture.
Is it ...
160
votes
5
answers
114k
views
UILabel - Wordwrap text
Is there any way to have a label wordwrap text as needed? I have the line breaks set to word wrap and the label is tall enough for two lines, but it appears that it will only wrap on line breaks. Do ...
160
votes
3
answers
84k
views
Simulate airplane mode in iPhone Simulator
Is there any way to simulate airplane mode in the iPhone Simulator?
159
votes
6
answers
63k
views
NSLog the method name with Objective-C in iPhone
Currently, we are defining ourselves an extended log mechanism to print out the class name and the source line number of the log.
#define NCLog(s, ...) NSLog(@"<%@:%d> %@", [[NSString ...
159
votes
12
answers
96k
views
ITunes review URL and iOS 7 (ask user to rate our app) AppStore show a blank page
Does anybody knows if the technique used to ask the user to rate our app and open for him the App Store directly on the rating page is still working on iOS 7 ?
I used to open this url from my app :
...
159
votes
10
answers
160k
views
How to remove an iOS app from the App Store
I want to remove my app, which is currently marked "Ready for sale", from the App Store. I could not find any documentation on this, and there is no "Remove from Sale" option in the "Manage Your Apps"...
159
votes
20
answers
134k
views
How to take a screenshot programmatically on iOS
I want a screenshot of the image on the screen saved into the saved photo library.
158
votes
29
answers
113k
views
How to remove border of the navigationBar in swift?
i've been trying to remove the navigationBars border without luck. I've researched and people seem to tell to set shadowImage and BackgroundImage to nil, but this does not work in my case.
My code
...
158
votes
22
answers
162k
views
How to detect the end of loading of UITableView
I want to change the offset of the table when the load is finished and that offset depends on the number of cells loaded on the table.
Is it anyway on the SDK to know when a uitableview loading has ...
158
votes
11
answers
63k
views
Reject binary with state waiting for review (can't find reject binary button)
I want to reject binary which is waiting for review and when I go to the path that Developer Guide specifies I can't find the button to reject the binary.
158
votes
10
answers
77k
views
iPhone: Detecting user inactivity/idle time since last screen touch
Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.
There's this ...
157
votes
12
answers
174k
views
UIButton Image + Text IOS
I need a UIButton with image & text. Image should be in the top & text comes under the image both should be clickable.
157
votes
10
answers
72k
views
What's the point of NSAssert, actually?
I have to ask this, because: The only thing I recognize is, that if the assertion fails, the app crashes. Is that the reason why to use NSAssert? Or what else is the benefit of it? And is it right to ...
157
votes
20
answers
132k
views
iPhone Safari Web App opens links in new window
I have problem with web after adding icon to Home Screen. If the web is launched from Home Screen, all links will open in new window in Safari (and lose full screen functionality). How can I prevent ...
156
votes
16
answers
94k
views
Display clearColor UIViewController over UIViewController
I have a UIViewController view as a subview/modal on top of another UIViewController view, such as that the subview/modal should be transparent and whatever components is added to the subview should ...
156
votes
9
answers
106k
views
iPhone get SSID without private library
I have a commercial app that has a completely legitimate reason to see the SSID of the network it is connected to: If it is connected to a Adhoc network for a 3rd party hardware device it needs to be ...
156
votes
19
answers
96k
views
How to detect total available/free disk space on the iPhone/iPad device?
I'm looking for a better way to detect available/free disk space on the iPhone/iPad device programmatically.
Currently I'm using the NSFileManager to detect the disk space. Following is the snippet of ...
156
votes
12
answers
34k
views
Is it true that one should not use NSLog() on production code?
I was told this a few times in this very site, but I wanted to make sure this is really the case.
I was expecting to be able to sprinkle NSLog function calls throughout my code, and that Xcode/gcc ...
156
votes
4
answers
66k
views
Where's the difference between setObject:forKey: and setValue:forKey: in NSMutableDictionary?
When looking at the documentation, I hardly see any big difference. Both "value" and "object" are of type id, so can be any object. Key is once a string, and in the other case an id. One of them seems ...
155
votes
13
answers
51k
views
Error : The service is invalid
I am having some problem in installing my app on the iphone as I am constantly getting the following error message
The service is invalid
Please check your setup and try again
(0XE8000022)...
155
votes
15
answers
259k
views
UILabel - auto-size label to fit text?
Is it possible to auto-resize the UILabel box/bounds to fit the contained text?
(I don't care if it ends up larger than the display)
So if a user enters "hello" or "my name is really long i want it ...
155
votes
18
answers
12k
views
Is MonoTouch now banned on the iPhone? [closed]
A recent post by John Gruber notes that the following legalese:
3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs.
Has ...
154
votes
19
answers
96k
views
Change Default Scrolling Behavior of UITableView Section Header
I have a UITableView with two sections. It is a simple table view. I am using viewForHeaderInSection to create custom views for these headers. So far, so good.
The default scrolling behavior is ...
154
votes
9
answers
136k
views
How to draw border around a UILabel?
Is there a way for UILabel to draw a border around itself? This is useful for me to debug the text placement and to see the placement and how big the label actually is.
154
votes
12
answers
142k
views
Re-sign IPA (iPhone)
I currently build all my applications with hudson using xcodebuild followed by a xcrun without any problems
I've received a couple of IPA files from different people that I would like to re-sign with ...
154
votes
3
answers
211k
views
What is a provisioning profile used for when developing iPhone applications?
What is the purpose of a provisioning profile and why is it needed when developing an iPhone application? If I don't have a provisioning profile, what happens?
153
votes
8
answers
82k
views
What exactly does @synthesize do?
I have seen the following piece of code:
//example.h
MKMapView * mapView1;
@property (nonatomic, retain) MKMapView * mapView;
//example.m
@synthesize mapView = mapView1
What is the relation between ...
152
votes
7
answers
77k
views
iPhone Simulator - Simulate a slow connection?
Is there a way to slow down the internet connection to the iPhone Simulator, so as to mimic how the App might react when you are in a slow spot on the cellular network?
152
votes
10
answers
147k
views
How to convert NSDate into unix timestamp iphone sdk?
How to convert an NSDate into Unix timestamp? I've read many posts which do the reverse. But I'm not finding anything related to my question.
152
votes
29
answers
180k
views
unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
My UITableViewController is causing a crash with the following error message:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with ...
152
votes
9
answers
112k
views
Create a folder inside documents folder in iOS apps
I just want to create new folders in the documents folder of my iPhone app.
Does anybody know how to do that?
Appreciate your help!