Questions tagged [cocoa-touch]

The Cocoa Touch Frameworks that drive iOS apps share many proven patterns found on the Mac, but were built with a special focus on touch-based interfaces and optimization.

Cocoa Touch is Apple's application-development framework for , consisting of Foundation, UIKit (), and Core Data ().

The Cocoa Touch frameworks that drive apps share many proven patterns found on the , but were built with a special focus on touch-based interfaces and optimization.

For development, see .

For Cocoapods, see .

Many Cocoa Touch questions deal with , , , or .

Debugging techniques

Cocoa programs can be debugged with many techniques and tools, both general and specific to , , , and .

Apple's Technical Note about debugging iOS applications

34585 questions
20
votes
4 answers

Where's the iPhone MIME type database?

I have a program for the iPhone that is supposed to be doing intelligent things (picking out appropriate icons for file types) given a list of filenames. I'm looking for the iPhone take on something like /etc/mime.types or something similar- an API…
Matt Erickson
  • 684
  • 1
  • 6
  • 12
20
votes
5 answers

Multiple view controllers on screen at once?

I am trying to wrap my head around controllers in Cocoa Touch. The main problem is that I would like to have more than one controller “on screen” at once – I want to have a large view (with controller A) composed of smaller views controlled by their…
zoul
  • 102,279
  • 44
  • 260
  • 354
20
votes
6 answers

How to pass the touch event to superview when userInteractionEnabled = YES?

I have the following setup. +- XXXCustomControl : UIControl -------+ | A | | +- ContentView -------------------+| | | || | | B || | | …
Earl Grey
  • 7,426
  • 6
  • 39
  • 59
20
votes
5 answers

Slow performance for presentViewController - depends on complexity of presentING controller?

I am presenting a view controller: SCAAboutController2 *controller = [[SCAAboutController2 alloc] initWithNibName:nil bundle:nil]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller]; [self…
Ben Packard
  • 26,102
  • 25
  • 102
  • 183
20
votes
5 answers

How to fade out the status bar while not hiding it

iOS Developers will surely knows about the issue about status bar and the famous "slide/hamburger/drawer". The issue is well explained here: http://uxmag.com/articles/adapting-ui-to-ios-7-the-side-menu I'm using MMDrawerController library and it has…
Fred Collins
  • 5,004
  • 14
  • 62
  • 111
20
votes
8 answers

iOS7 TextKit: bullet point alignment

I'm writing an app for iOS 7 only and I'm trying to get decent formatting on bullet points in a non-editable UITextView. It's easy enough to just insert a bullet point character, but of course the left indentation won't follow. What's the easiest…
Frank R.
  • 2,328
  • 1
  • 24
  • 44
20
votes
2 answers

How to detect tap on UITextField?

I have a UITextField that has User Interaction Disabled. So if you tap on this text field, nothing happens. Normally to check if a text field was tapped Id try the delegate methods, but I cannot because user interaction is disabled. Is there any way…
Josue Espinosa
  • 5,009
  • 16
  • 47
  • 81
20
votes
8 answers

How to make a macro that can take a string?

I'm trying to do something really trivial: A macro that takes an string and prints that to NSLog. Like this: #define PRINTTHIS(text) \ NSLog(@"text"); However, when I try to pass a string to this guy I end up getting "text" printed to the…
20
votes
2 answers

Are viewDidUnload and dealloc always called when tearing down a UIViewController?

I'd like to know whether or not both viewDidUnload and dealloc are always called in succession in the UIViewController tear-down process. Is it possible that dealloc could be called on my view controller without viewDidUnload having been called…
Jessedc
  • 12,320
  • 3
  • 50
  • 63
20
votes
2 answers

Calling `[UIView -systemLayoutSizeFittingSize:]` on a UITableViewCell always fails

I want to use auto-layout for UITableViewCells. These table cells have a dynamic height (depending on text length). I'm using [UIView -systemLayoutSizeFittingSize:] to calculate the appropriate cell height (to return in [UITableView…
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
20
votes
4 answers

Xcode 3.2 find and replace in selected text

Is it possible to find and replace in selected text in Snow Leopard Xcode 3.2? There always use to be an option for selected text. Really frustrating. Thanks.
RunLoop
  • 20,288
  • 21
  • 96
  • 151
20
votes
2 answers

How to play system sound on iOS without vibration?

In the documentation of AudioServicesPlayAlertSound, it says I can disable vibration when playing a sound: iPhone—plays the specified sound. If the user has configured the Settings application for vibration on ring, also invokes vibration. …
JoJo
  • 19,587
  • 34
  • 106
  • 162
20
votes
6 answers

Decrease the width of the last line in multiline UILabel

I am implemententing a "read more" functionality much like the one in Apple's AppStore. However, I am using a multiline UILabel. Looking at Apple's AppStore, how do they decrease the last visible line's width to fit the "more" text and still…
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
20
votes
5 answers

UIScrollView. Any thoughts on implementing "infinite" scroll/zoom?

So, UITableView supports essentially "infinite" scrolling. There' may be a limit but that sucker can scroll for a looonnnggg time. I would like to mimic this behavior with a UIScrollView but there are two fundamental impediments: 1)…
dugla
  • 12,774
  • 26
  • 88
  • 136
20
votes
7 answers

Differences between [NSArray arrayWithArray:] and [NSArray copy]

lately I work much with arrays and I'm wonder.. what's diffrences between those two lines. NSArray *array = [NSArray arrayWithArray:someArray]; and NSArray *array = [someArray copy]; Which of it is faster? What in case we have NSMutableArray and…
Błażej
  • 3,617
  • 7
  • 35
  • 62